Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
41 | public function equals(DateFormatValueObjectInterface $other): bool |
||
42 | { |
||
43 | if (static::class !== get_class($other)) { |
||
44 | return false; |
||
45 | } |
||
46 | if ($this->getValue() === null xor $other->getValue() === null) { |
||
47 | return false; |
||
48 | } |
||
49 | if ($this->getValue() === $other->getValue()) { |
||
50 | return true; |
||
51 | } |
||
52 | /** @var DateTimeImmutable $dateTime */ |
||
53 | $dateTime = $this->getDateTime(); |
||
54 | /** @var DateTimeImmutable $otherDateTime */ |
||
55 | $otherDateTime = $other->getDateTime(); |
||
56 | return $dateTime->getTimestamp() === $otherDateTime->getTimestamp(); |
||
57 | } |
||
71 |