1 | <?php |
||
24 | final class TimeFrame |
||
25 | { |
||
26 | /** |
||
27 | * @var DateInterval |
||
28 | */ |
||
29 | private $timeFrame; |
||
30 | |||
31 | /** |
||
32 | * @param DateInterval $timeFrame |
||
33 | */ |
||
34 | final private function __construct(DateInterval $timeFrame) |
||
38 | |||
39 | /** |
||
40 | * @param int $seconds |
||
41 | * @return TimeFrame |
||
42 | */ |
||
43 | public static function ofSeconds($seconds) |
||
51 | |||
52 | /** |
||
53 | * @param DateTime $dateTime |
||
54 | * @return DateTime |
||
55 | */ |
||
56 | public function getEndWhenStartingAt(DateTime $dateTime) |
||
60 | |||
61 | /** |
||
62 | * @param TimeFrame $other |
||
63 | * @return bool |
||
64 | */ |
||
65 | public function equals(TimeFrame $other) |
||
69 | |||
70 | public function __toString() |
||
74 | } |
||
75 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.