Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
25 | public function create(array $config = []): DateTimeFactory |
||
26 | { |
||
27 | $dateTimeClassName = $config['date_class_name'] ?? null; |
||
28 | $dateTimeZoneClassName = $config['time_zone_class_name'] ?? null; |
||
29 | |||
30 | try { |
||
31 | return new DateTimeFactory($dateTimeClassName, $dateTimeZoneClassName); |
||
32 | } catch (DateTimeFactoryException $e) { |
||
33 | throw new FactoryException( |
||
34 | sprintf('Failed to create DateTimeFactory: %s', $e->getMessage()), |
||
35 | $e->getCode(), |
||
36 | $e |
||
37 | ); |
||
41 |