DateTimeZoneFactory

Class
Final: Yes

Factory for creating DateTimeZone instances for the Fast Forward Container.

Description

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

Tags

Table of Contents

Methods

__invoke()

Creates a DateTimeZone instance using configuration from the container.

 : DateTimeZone
Methods

__invoke()

Public

Creates a DateTimeZone instance using configuration from the container.

public __invoke(ContainerInterface  $container) : DateTimeZone

Description

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
$container : ContainerInterface

Description

the container from which to retrieve configuration

Return values
DateTimeZone

Description

the resolved DateTimeZone instance