Skip to content

DateTimeZoneFactory

github-actions edited this page Apr 7, 2026 · 1 revision

Factory for creating DateTimeZone instances for the Fast Forward Container.

This factory SHALL return a DateTimeZone instance based on configuration, or fallback to the default timezone.


  • Full name: \FastForward\Clock\ServiceProvider\Factory\DateTimeZoneFactory
  • This class is marked as final and can't be subclassed
  • This class is a Final class

See Also:

Methods

__invoke

Creates a DateTimeZone instance using configuration from the container.

public __invoke(\Psr\Container\ContainerInterface $container): \DateTimeZone

If the container does not provide a ConfigInterface, or the configuration does not specify a timezone, this method SHALL return a DateTimeZone using the current default timezone.

If the configuration value for DateTimeZone::class is already a DateTimeZone instance, it SHALL be returned as-is. Otherwise, the value SHALL be used as the timezone identifier string.

Parameters:

Parameter Type Description
$container \Psr\Container\ContainerInterface the container from which to retrieve configuration

Return Value:

the resolved DateTimeZone instance


Clone this wiki locally