Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
28 | public function equals(DateFormatValueObjectInterface $other): bool |
||
29 | { |
||
30 | if (static::class !== get_class($other)) { |
||
31 | return false; |
||
32 | } |
||
33 | if ($this->getValue() === null xor $other->getValue() === null) { |
||
34 | return false; |
||
35 | } |
||
36 | if ($this->getValue() === $other->getValue()) { |
||
37 | return true; |
||
38 | } |
||
39 | /** @var DateTimeImmutable $dateTime */ |
||
40 | $dateTime = $this->getDateTime(); |
||
41 | /** @var DateTimeImmutable $otherDateTime */ |
||
42 | $otherDateTime = $other->getDateTime(); |
||
43 | return $dateTime->getTimestamp() === $otherDateTime->getTimestamp(); |
||
44 | } |
||
64 |