@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | break; |
95 | 95 | |
96 | 96 | case self::LAST_YEAR: |
97 | - $year = ((int) date('Y'))- 1; |
|
97 | + $year = ((int) date('Y')) - 1; |
|
98 | 98 | break; |
99 | 99 | |
100 | 100 | default: |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $d->setDate($year, (int) $d->format('m'), (int) $d->format('d')); |
143 | 143 | } |
144 | 144 | |
145 | - $d->add(new \DateInterval('P'.($day - 1).'D')); |
|
145 | + $d->add(new \DateInterval('P' . ($day - 1) . 'D')); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | return $d; |
@@ -63,8 +63,9 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public static function getMonth($month_number) |
65 | 65 | { |
66 | - if (!array_key_exists($month_number, self::MONTHS)) |
|
67 | - throw new Exception\MonthOutOfRange("Invalid Month"); |
|
66 | + if (!array_key_exists($month_number, self::MONTHS)) { |
|
67 | + throw new Exception\MonthOutOfRange("Invalid Month"); |
|
68 | + } |
|
68 | 69 | |
69 | 70 | return self::MONTHS[$month_number]; |
70 | 71 | } |
@@ -78,14 +79,17 @@ discard block |
||
78 | 79 | */ |
79 | 80 | public static function create(array $date = []) |
80 | 81 | { |
81 | - if (!array_key_exists('day', $date)) |
|
82 | - $date["day"] = self::TODAY; |
|
82 | + if (!array_key_exists('day', $date)) { |
|
83 | + $date["day"] = self::TODAY; |
|
84 | + } |
|
83 | 85 | |
84 | - if (!array_key_exists('month', $date)) |
|
85 | - $date["month"] = self::THIS_MONTH; |
|
86 | + if (!array_key_exists('month', $date)) { |
|
87 | + $date["month"] = self::THIS_MONTH; |
|
88 | + } |
|
86 | 89 | |
87 | - if (!array_key_exists('year', $date)) |
|
88 | - $date["year"] = self::THIS_YEAR; |
|
90 | + if (!array_key_exists('year', $date)) { |
|
91 | + $date["year"] = self::THIS_YEAR; |
|
92 | + } |
|
89 | 93 | |
90 | 94 | switch ($date['year']) |
91 | 95 | { |
@@ -130,13 +134,13 @@ discard block |
||
130 | 134 | break; |
131 | 135 | } |
132 | 136 | |
133 | - if (is_string($day)) |
|
134 | - $d = new \DateTime("$day $month $year"); |
|
135 | - else |
|
137 | + if (is_string($day)) { |
|
138 | + $d = new \DateTime("$day $month $year"); |
|
139 | + } else |
|
136 | 140 | { |
137 | - if (in_array($month, self::MONTHS)) |
|
138 | - $d = new \DateTime("first day of $month $year"); |
|
139 | - else |
|
141 | + if (in_array($month, self::MONTHS)) { |
|
142 | + $d = new \DateTime("first day of $month $year"); |
|
143 | + } else |
|
140 | 144 | { |
141 | 145 | $d = new \DateTime("first day of $month"); |
142 | 146 | $d->setDate($year, (int) $d->format('m'), (int) $d->format('d')); |