Total Complexity | 2 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
18 | final class DateTimeFactory implements DateTimeFactoryInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private const DEFAULT_TIMEZONE = 'UTC'; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private const DATE_NOW = 'now'; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $timezone; |
||
34 | |||
35 | /** |
||
36 | * @param string $timezone |
||
37 | */ |
||
38 | public function __construct(string $timezone = self::DEFAULT_TIMEZONE) |
||
39 | { |
||
40 | $this->timezone = new \DateTimeZone($timezone); |
||
|
|||
41 | } |
||
42 | |||
43 | /** |
||
44 | * {@inheritDoc} |
||
45 | */ |
||
46 | public function now(): \DateTimeImmutable |
||
49 | } |
||
50 | } |
||
51 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..