Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | public function __invoke( |
||
20 | ContainerInterface $container, |
||
21 | string $requestedName, |
||
22 | array $options = null |
||
23 | ): DateTimeZoneFactory { |
||
24 | $options = $options ?? $this->getServiceOptions($container, $requestedName, 'laminas_date_time'); |
||
25 | |||
26 | try { |
||
27 | return new DateTimeZoneFactory( |
||
28 | $options['class_name'] ?? \DateTimeZone::class, |
||
29 | ); |
||
30 | } catch (DateTimeZoneFactoryException $e) { |
||
31 | throw new ServiceNotCreatedException( |
||
32 | sprintf('Failed to create date time zone factory \'%s\'', $requestedName), |
||
33 | $e->getCode(), |
||
34 | $e, |
||
35 | ); |
||
39 |