@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * Callback for Twig to get all the filters. |
| 33 | 33 | * |
| 34 | - * @return \Twig_Filter[] |
|
| 34 | + * @return \Twig_SimpleFilter[] |
|
| 35 | 35 | */ |
| 36 | 36 | public function getFilters() |
| 37 | 37 | { |
@@ -211,6 +211,7 @@ discard block |
||
| 211 | 211 | * Split duration into seconds, minutes, hours, days, weeks and years. |
| 212 | 212 | * |
| 213 | 213 | * @param int $seconds |
| 214 | + * @param integer $max |
|
| 214 | 215 | * @return array |
| 215 | 216 | */ |
| 216 | 217 | protected function splitDuration($seconds, $max) |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | if ( |
| 130 | 130 | (is_int($datetype) && $datetype !== \IntlDateFormatter::NONE) || |
| 131 | 131 | (is_int($timetype) && $timetype !== \IntlDateFormatter::NONE) |
| 132 | - ){ |
|
| 132 | + ) { |
|
| 133 | 133 | $pattern = \IntlDateFormatter::create( |
| 134 | 134 | \Locale::getDefault(), |
| 135 | 135 | is_int($datetype) ? $datetype : \IntlDateFormatter::NONE, |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | * @param string $calendar 'gregorian' or 'traditional' |
| 195 | 195 | * @return string |
| 196 | 196 | */ |
| 197 | - public function localTime($date, $format='short', $calendar='gregorian') |
|
| 197 | + public function localTime($date, $format = 'short', $calendar = 'gregorian') |
|
| 198 | 198 | { |
| 199 | 199 | return $this->formatLocal($date, false, $format, $calendar); |
| 200 | 200 | } |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | if ( |
| 130 | 130 | (is_int($datetype) && $datetype !== \IntlDateFormatter::NONE) || |
| 131 | 131 | (is_int($timetype) && $timetype !== \IntlDateFormatter::NONE) |
| 132 | - ){ |
|
| 132 | + ) { |
|
| 133 | 133 | $pattern = \IntlDateFormatter::create( |
| 134 | 134 | \Locale::getDefault(), |
| 135 | 135 | is_int($datetype) ? $datetype : \IntlDateFormatter::NONE, |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function product($array) |
| 54 | 54 | { |
| 55 | - return isset($array) ? array_product((array)$array) : null; |
|
| 55 | + return isset($array) ? array_product((array)$array) : null; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function values($array) |
| 65 | 65 | { |
| 66 | - return isset($array) ? array_values((array)$array) : null; |
|
| 66 | + return isset($array) ? array_values((array)$array) : null; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | if ($match[1]) $protocol = $match[1]; |
| 120 | 120 | $link = $match[2] ?: $match[3]; |
| 121 | 121 | |
| 122 | - return '<' . array_push($links, '<a' . $attr . ' href="' . $protocol . '://' . $link . '">' |
|
| 122 | + return '<' . array_push($links, '<a' . $attr . ' href="' . $protocol . '://' . $link . '">' |
|
| 123 | 123 | . rtrim($link, '/') . '</a>') . '>'; |
| 124 | 124 | }, $text); |
| 125 | 125 | } |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $regexp = '~([^\s<>]+?@[^\s<>]+?\.[^\s<>]+)(?<![\.,:;\?!\'"\|])~'; |
| 137 | 137 | |
| 138 | 138 | return preg_replace_callback($regexp, function ($match) use (&$links, $attr) { |
| 139 | - return '<' . array_push($links, '<a' . $attr . ' href="mailto:' . $match[1] . '">' . $match[1] . '</a>') |
|
| 139 | + return '<' . array_push($links, '<a' . $attr . ' href="mailto:' . $match[1] . '">' . $match[1] . '</a>') |
|
| 140 | 140 | . '>'; |
| 141 | 141 | }, $text); |
| 142 | 142 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | protected function linkifyOther($protocol, $text, array &$links, $attr, $mode) |
| 155 | 155 | { |
| 156 | 156 | if (strpos($protocol, ':') === false) { |
| 157 | - $protocol .= in_array($protocol, ['ftp', 'tftp', 'ssh', 'scp']) ? '://' : ':'; |
|
| 157 | + $protocol .= in_array($protocol, ['ftp', 'tftp', 'ssh', 'scp']) ? '://' : ':'; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | $regexp = $mode != 'all' |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | : '~([^\s<>]+)(?<![\.,:])~i'; |
| 163 | 163 | |
| 164 | 164 | return preg_replace_callback($regexp, function ($match) use ($protocol, &$links, $attr) { |
| 165 | - return '<' . array_push($links, '<a' . $attr . ' href="' . $protocol . $match[1] . '">' . $match[1] |
|
| 165 | + return '<' . array_push($links, '<a' . $attr . ' href="' . $protocol . $match[1] . '">' . $match[1] |
|
| 166 | 166 | . '</a>') . '>'; |
| 167 | 167 | }, $text); |
| 168 | 168 | } |