@@ -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) { |
@@ -171,11 +171,11 @@ discard block |
||
171 | 171 | $label .= '_PLURAL'; |
172 | 172 | } |
173 | 173 | |
174 | - $ordering[$unit] = $qty . ' ' . $this->l($label) . '.'; |
|
174 | + $ordering[$unit] = $qty.' '.$this->l($label).'.'; |
|
175 | 175 | } |
176 | 176 | $ret = 'DATETIME_RANGE_PREFIX_'; |
177 | - $ret.= (isset($amount_of_days) && $amount_of_days >= 0) ? 'FUTURE' : 'PAST'; |
|
178 | - $ret = $this->l($ret) . ' ' . implode(' & ', array_slice($ordering, 0, 2)); |
|
177 | + $ret .= (isset($amount_of_days) && $amount_of_days >= 0) ? 'FUTURE' : 'PAST'; |
|
178 | + $ret = $this->l($ret).' '.implode(' & ', array_slice($ordering, 0, 2)); |
|
179 | 179 | |
180 | 180 | return $ret; |
181 | 181 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | |
201 | 201 | list($year, $month, $day) = explode('-', $date_string); |
202 | 202 | |
203 | - $ret = intval($day) . ' ' . $this->l("DATETIME_CALENDAR_MONTH_$month"); |
|
203 | + $ret = intval($day).' '.$this->l("DATETIME_CALENDAR_MONTH_$month"); |
|
204 | 204 | |
205 | 205 | if ($short === true && Dato::format(null, 'Y') === $year) { |
206 | 206 | return $ret; |
@@ -211,18 +211,18 @@ discard block |
||
211 | 211 | |
212 | 212 | public function month($date_string) |
213 | 213 | { |
214 | - return $this->l('DATETIME_CALENDAR_MONTH_' . Dato::format($date_string, 'm')); |
|
214 | + return $this->l('DATETIME_CALENDAR_MONTH_'.Dato::format($date_string, 'm')); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | public function day($date_string) |
218 | 218 | { |
219 | - return $this->l('DATETIME_CALENDAR_DAY_' . Dato::format($date_string, 'N')); |
|
219 | + return $this->l('DATETIME_CALENDAR_DAY_'.Dato::format($date_string, 'N')); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | public function seconds($seconds) |
223 | 223 | { |
224 | 224 | $hours = floor($seconds / 3600); |
225 | - $mins = floor(($seconds - $hours * 3600) / 60); |
|
225 | + $mins = floor(($seconds-$hours * 3600) / 60); |
|
226 | 226 | $secs = floor($seconds % 60); |
227 | 227 | |
228 | 228 | $hours_format = '%dh %dm %ds'; |