1 | <?php |
||
11 | class RepetitiveInterval |
||
12 | { |
||
13 | const ONE_WEEK = 7; |
||
14 | const TWO_WEEKS = 14; |
||
15 | |||
16 | /** |
||
17 | * @var int |
||
18 | */ |
||
19 | private $interval; |
||
20 | |||
21 | |||
22 | |||
23 | /** |
||
24 | * @param $interval |
||
25 | */ |
||
26 | private function __construct($interval) |
||
40 | |||
41 | |||
42 | |||
43 | /** |
||
44 | * @return int |
||
45 | */ |
||
46 | public function interval() |
||
50 | |||
51 | |||
52 | |||
53 | /** |
||
54 | * @return RepetitiveInterval |
||
55 | */ |
||
56 | public static function oneWeek() |
||
60 | |||
61 | |||
62 | |||
63 | /** |
||
64 | * @return RepetitiveInterval |
||
65 | */ |
||
66 | public static function twoWeeks() |
||
70 | |||
71 | |||
72 | |||
73 | /** |
||
74 | * @param int $number |
||
75 | * |
||
76 | * @return RepetitiveInterval |
||
77 | */ |
||
78 | public static function fromNumber($number) |
||
82 | } |