@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | namespace HexMakina\Lezer; |
11 | 11 | |
12 | 12 | use HexMakina\LocalFS\FileSystem; |
13 | -use HexMakina\Tempus\{Dato,DatoTempo,Tempo}; |
|
13 | +use HexMakina\Tempus\{Dato, DatoTempo, Tempo}; |
|
14 | 14 | |
15 | 15 | class Lezer extends \i18n |
16 | 16 | { |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | public function compileFunction() |
56 | 56 | { |
57 | 57 | return '' |
58 | - . "function " . $this->prefix . '($string, $args=NULL) {' . "\n" |
|
59 | - . ' if (!defined("' . $this->prefix . '::".$string))' |
|
58 | + . "function ".$this->prefix.'($string, $args=NULL) {'."\n" |
|
59 | + . ' if (!defined("'.$this->prefix.'::".$string))' |
|
60 | 60 | . ' return $string;' |
61 | - . ' $return = constant("' . $this->prefix . '::".$string);' . "\n" |
|
61 | + . ' $return = constant("'.$this->prefix.'::".$string);'."\n" |
|
62 | 62 | . ' return $args ? vsprintf($return,$args) : $return;' |
63 | 63 | . "\n}"; |
64 | 64 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | try { |
133 | 133 | $amount_of_days = DatoTempo::days_diff(new \DateTime($event), new \DateTime()); |
134 | 134 | } catch (\Exception $e) { |
135 | - return __FUNCTION__ . ': error'; |
|
135 | + return __FUNCTION__.': error'; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | if ($amount_of_days === -1) { |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | $label .= '_PLURAL'; |
174 | 174 | } |
175 | 175 | |
176 | - $ordering[$unit] = $qty . ' ' . L($label) . '.'; |
|
176 | + $ordering[$unit] = $qty.' '.L($label).'.'; |
|
177 | 177 | } |
178 | 178 | $ret = (isset($amount_of_days) && $amount_of_days >= 0) ? L('DATETIME_RANGE_PREFIX_FUTURE') : L('DATETIME_RANGE_PREFIX_PAST'); |
179 | - $ret .= ' ' . implode(' & ', array_slice($ordering, 0, 2)); |
|
179 | + $ret .= ' '.implode(' & ', array_slice($ordering, 0, 2)); |
|
180 | 180 | |
181 | 181 | return $ret; |
182 | 182 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | |
202 | 202 | list($year, $month, $day) = explode('-', $date_string); |
203 | 203 | |
204 | - $ret = intval($day) . ' ' . L("DATETIME_CALENDAR_MONTH_$month"); |
|
204 | + $ret = intval($day).' '.L("DATETIME_CALENDAR_MONTH_$month"); |
|
205 | 205 | |
206 | 206 | if ($short === true && Dato::format(null, 'Y') === $year) { |
207 | 207 | return $ret; |
@@ -212,18 +212,18 @@ discard block |
||
212 | 212 | |
213 | 213 | public static function human_month($date_string) |
214 | 214 | { |
215 | - return L('DATETIME_CALENDAR_MONTH_' . Dato::format($date_string, 'm')); |
|
215 | + return L('DATETIME_CALENDAR_MONTH_'.Dato::format($date_string, 'm')); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | public static function human_day($date_string) |
219 | 219 | { |
220 | - return L('DATETIME_CALENDAR_DAY_' . Dato::format($date_string, 'N')); |
|
220 | + return L('DATETIME_CALENDAR_DAY_'.Dato::format($date_string, 'N')); |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | public static function human_seconds($seconds) |
224 | 224 | { |
225 | 225 | $hours = floor($seconds / 3600); |
226 | - $mins = floor(($seconds - $hours * 3600) / 60); |
|
226 | + $mins = floor(($seconds-$hours * 3600) / 60); |
|
227 | 227 | $secs = floor($seconds % 60); |
228 | 228 | |
229 | 229 | $hours_format = '%dh %dm %ds'; |