|
6 | 6 | * Class Hours |
7 | 7 | * @package Dgame\Time\Unit |
8 | 8 | */ |
9 | | -final class Hours extends TimeUnit |
| 9 | +final class Hours extends AbstractTimeUnit |
10 | 10 | { |
11 | | - const HOURS_PER_DAY = 24; |
12 | | - const HOURS_PER_WEEK = 168; |
13 | | - const HOURS_PER_MONTH = 730.56; |
14 | | - const HOURS_PER_YEAR = 8760; |
| 11 | + const HOURS_PER_DAY = 24; |
| 12 | + const HOURS_PER_WEEK = 168; |
| 13 | + const HOURS_PER_MONTH = 730.56; |
| 14 | + const HOURS_PER_YEAR = 8760; |
15 | 15 |
|
16 | 16 | /** |
17 | 17 | * @return Seconds |
@@ -70,31 +70,31 @@ public function inYears(): Years |
70 | 70 | } |
71 | 71 |
|
72 | 72 | /** |
73 | | - * @param TimeUnit $unit |
| 73 | + * @param TimeUnitInterface $unit |
74 | 74 | * |
75 | | - * @return TimeUnit |
| 75 | + * @return TimeUnitInterface |
76 | 76 | */ |
77 | | - public function add(TimeUnit $unit): TimeUnit |
| 77 | + public function add(TimeUnitInterface $unit): TimeUnitInterface |
78 | 78 | { |
79 | 79 | return new self($this->getAmount() + $unit->inHours()->getAmount()); |
80 | 80 | } |
81 | 81 |
|
82 | 82 | /** |
83 | | - * @param TimeUnit $unit |
| 83 | + * @param TimeUnitInterface $unit |
84 | 84 | * |
85 | | - * @return TimeUnit |
| 85 | + * @return TimeUnitInterface |
86 | 86 | */ |
87 | | - public function subtract(TimeUnit $unit): TimeUnit |
| 87 | + public function subtract(TimeUnitInterface $unit): TimeUnitInterface |
88 | 88 | { |
89 | 89 | return new self($this->getAmount() - $unit->inHours()->getAmount()); |
90 | 90 | } |
91 | 91 |
|
92 | 92 | /** |
93 | | - * @param TimeUnit $unit |
| 93 | + * @param TimeUnitInterface $unit |
94 | 94 | * |
95 | 95 | * @return bool |
96 | 96 | */ |
97 | | - public function equals(TimeUnit $unit): bool |
| 97 | + public function equals(TimeUnitInterface $unit): bool |
98 | 98 | { |
99 | 99 | return $this->equalsAmount($unit->inHours()->getAmount()); |
100 | 100 | } |
|
0 commit comments