@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | namespace HexMakina\Lezer; |
12 | 12 | |
13 | 13 | use HexMakina\LocalFS\FileSystem; |
14 | -use HexMakina\Tempus\{Dato,DatoTempo,Tempo}; |
|
14 | +use HexMakina\Tempus\{Dato, DatoTempo, Tempo}; |
|
15 | 15 | |
16 | 16 | class Lezer extends \i18n |
17 | 17 | { |
@@ -107,10 +107,10 @@ discard block |
||
107 | 107 | public function compileFunction() |
108 | 108 | { |
109 | 109 | return '' |
110 | - . "function " . $this->prefix . '($string, $args=NULL) {' . "\n" |
|
111 | - . ' if (!defined("' . $this->prefix . '::".$string))' |
|
110 | + . "function ".$this->prefix.'($string, $args=NULL) {'."\n" |
|
111 | + . ' if (!defined("'.$this->prefix.'::".$string))' |
|
112 | 112 | . ' return $string;' |
113 | - . ' $return = constant("' . $this->prefix . '::".$string);' . "\n" |
|
113 | + . ' $return = constant("'.$this->prefix.'::".$string);'."\n" |
|
114 | 114 | . ' return $args ? vsprintf($return,$args) : $return;' |
115 | 115 | . "\n}"; |
116 | 116 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | try { |
129 | 129 | $amount_of_days = DatoTempo::days_diff(new \DateTime($event), new \DateTime()); |
130 | 130 | } catch (\Exception $e) { |
131 | - return __FUNCTION__ . ': error'; |
|
131 | + return __FUNCTION__.': error'; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | if ($amount_of_days === -1) { |
@@ -169,11 +169,11 @@ discard block |
||
169 | 169 | $label .= '_PLURAL'; |
170 | 170 | } |
171 | 171 | |
172 | - $ordering[$unit] = $qty . ' ' . $this->l($label) . '.'; |
|
172 | + $ordering[$unit] = $qty.' '.$this->l($label).'.'; |
|
173 | 173 | } |
174 | 174 | $ret = (isset($amount_of_days) && $amount_of_days >= 0) |
175 | 175 | ? 'DATETIME_RANGE_PREFIX_FUTURE' : 'DATETIME_RANGE_PREFIX_PAST'; |
176 | - $ret .= $this->l($ret) . ' ' . implode(' & ', array_slice($ordering, 0, 2)); |
|
176 | + $ret .= $this->l($ret).' '.implode(' & ', array_slice($ordering, 0, 2)); |
|
177 | 177 | |
178 | 178 | return $ret; |
179 | 179 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | list($year, $month, $day) = explode('-', $date_string); |
200 | 200 | |
201 | - $ret = intval($day) . ' ' . $this->l("DATETIME_CALENDAR_MONTH_$month"); |
|
201 | + $ret = intval($day).' '.$this->l("DATETIME_CALENDAR_MONTH_$month"); |
|
202 | 202 | |
203 | 203 | if ($short === true && Dato::format(null, 'Y') === $year) { |
204 | 204 | return $ret; |
@@ -209,18 +209,18 @@ discard block |
||
209 | 209 | |
210 | 210 | public function month($date_string) |
211 | 211 | { |
212 | - return $this->l('DATETIME_CALENDAR_MONTH_' . Dato::format($date_string, 'm')); |
|
212 | + return $this->l('DATETIME_CALENDAR_MONTH_'.Dato::format($date_string, 'm')); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | public function day($date_string) |
216 | 216 | { |
217 | - return $this->l('DATETIME_CALENDAR_DAY_' . Dato::format($date_string, 'N')); |
|
217 | + return $this->l('DATETIME_CALENDAR_DAY_'.Dato::format($date_string, 'N')); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | public function seconds($seconds) |
221 | 221 | { |
222 | 222 | $hours = floor($seconds / 3600); |
223 | - $mins = floor(($seconds - $hours * 3600) / 60); |
|
223 | + $mins = floor(($seconds-$hours * 3600) / 60); |
|
224 | 224 | $secs = floor($seconds % 60); |
225 | 225 | |
226 | 226 | $hours_format = '%dh %dm %ds'; |