@@ -45,7 +45,7 @@ |
||
| 45 | 45 | ViewSource $view, |
| 46 | 46 | string $code |
| 47 | 47 | ): string { |
| 48 | - return preg_replace_callback($this->pattern, function ($matches) use ($environment) { |
|
| 48 | + return preg_replace_callback($this->pattern, function($matches) use ($environment) { |
|
| 49 | 49 | return $environment->getValue($matches[1]); |
| 50 | 50 | }, $code); |
| 51 | 51 | } |
@@ -115,7 +115,7 @@ |
||
| 115 | 115 | */ |
| 116 | 116 | public function localeDirectory(string $locale): string |
| 117 | 117 | { |
| 118 | - return $this->config['localesDirectory'] . $locale . '/'; |
|
| 118 | + return $this->config['localesDirectory'].$locale.'/'; |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /** |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | */ |
| 114 | 114 | protected function configFilename(string $config): string |
| 115 | 115 | { |
| 116 | - return $this->directory . $config . static::EXTENSION; |
|
| 116 | + return $this->directory.$config.static::EXTENSION; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | public static function shorter(string $string, int $limit = 300): string |
| 78 | 78 | { |
| 79 | 79 | if (mb_strlen($string) + 3 > $limit) { |
| 80 | - return trim(mb_substr($string, 0, $limit - 3, 'UTF-8')) . '...'; |
|
| 80 | + return trim(mb_substr($string, 0, $limit - 3, 'UTF-8')).'...'; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | return $string; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $bytes /= 1024; |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - return number_format($bytes, $unit ? $decimals : 0) . " " . $pows[$unit]; |
|
| 101 | + return number_format($bytes, $unit ? $decimals : 0)." ".$pows[$unit]; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | strlen(str_replace("\t", $tabulationCost, $indent)) - $minIndent |
| 188 | 188 | ); |
| 189 | 189 | |
| 190 | - $line = $useIndent . substr($line, strlen($indent)); |
|
| 190 | + $line = $useIndent.substr($line, strlen($indent)); |
|
| 191 | 191 | unset($line); |
| 192 | 192 | } |
| 193 | 193 | |
@@ -253,20 +253,20 @@ |
||
| 253 | 253 | public function createHeader(): string |
| 254 | 254 | { |
| 255 | 255 | $header = [ |
| 256 | - rawurlencode($this->name) . '=' . rawurlencode($this->value) |
|
| 256 | + rawurlencode($this->name).'='.rawurlencode($this->value) |
|
| 257 | 257 | ]; |
| 258 | 258 | |
| 259 | 259 | if ($this->lifetime !== null) { |
| 260 | - $header[] = 'Expires=' . gmdate(\DateTime::COOKIE, $this->getExpires()); |
|
| 261 | - $header[] = 'Max-Age=' . $this->lifetime; |
|
| 260 | + $header[] = 'Expires='.gmdate(\DateTime::COOKIE, $this->getExpires()); |
|
| 261 | + $header[] = 'Max-Age='.$this->lifetime; |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | if (!empty($this->path)) { |
| 265 | - $header[] = 'Path=' . $this->path; |
|
| 265 | + $header[] = 'Path='.$this->path; |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | if (!empty($this->domain)) { |
| 269 | - $header[] = 'Domain=' . $this->domain; |
|
| 269 | + $header[] = 'Domain='.$this->domain; |
|
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | if ($this->secure) { |
@@ -162,11 +162,11 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | while (ob_get_level() > $outputLevel + 1) { |
| 165 | - $output = ob_get_clean() . $output; |
|
| 165 | + $output = ob_get_clean().$output; |
|
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - return $this->wrapResponse($response, $result, ob_get_clean() . $output); |
|
| 169 | + return $this->wrapResponse($response, $result, ob_get_clean().$output); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /** |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | Request $outerRequest, |
| 215 | 215 | Response $outerResponse |
| 216 | 216 | ): \Closure { |
| 217 | - $next = function ($request = null, $response = null) use ( |
|
| 217 | + $next = function($request = null, $response = null) use ( |
|
| 218 | 218 | $position, |
| 219 | 219 | $outerRequest, |
| 220 | 220 | $outerResponse |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function fetch(array $keys, bool $fill = false, $filler = null) |
| 116 | 116 | { |
| 117 | - $result = array_intersect_key($this->all(), array_flip($keys));; |
|
| 117 | + $result = array_intersect_key($this->all(), array_flip($keys)); ; |
|
| 118 | 118 | if (!$fill) { |
| 119 | 119 | return $result; |
| 120 | 120 | } |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $data = $this->data; |
| 181 | 181 | |
| 182 | 182 | //Generating path relative to a given name and prefix |
| 183 | - $path = (!empty($this->prefix) ? $this->prefix . '.' : '') . $name; |
|
| 183 | + $path = (!empty($this->prefix) ? $this->prefix.'.' : '').$name; |
|
| 184 | 184 | if (empty($path)) { |
| 185 | 185 | return $data; |
| 186 | 186 | } |
@@ -49,8 +49,6 @@ |
||
| 49 | 49 | /** |
| 50 | 50 | * {@inheritdoc} |
| 51 | 51 | * |
| 52 | - * @param RouteInterface|array $default Default route or options to construct instance of |
|
| 53 | - * DirectRoute. |
|
| 54 | 52 | * @param string $basePath Automatically added to all urls. |
| 55 | 53 | * |
| 56 | 54 | * @throws RouterException |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | public function withPrefix(string $prefix): RouteInterface |
| 144 | 144 | { |
| 145 | 145 | $route = clone $this; |
| 146 | - $route->prefix = rtrim($prefix, '/') . '/'; |
|
| 146 | + $route->prefix = rtrim($prefix, '/').'/'; |
|
| 147 | 147 | |
| 148 | 148 | return $route; |
| 149 | 149 | } |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | ); |
| 276 | 276 | |
| 277 | 277 | //Uri with added prefix |
| 278 | - $uri = new Uri(($this->withHost ? '' : $this->prefix) . trim($path, '/')); |
|
| 278 | + $uri = new Uri(($this->withHost ? '' : $this->prefix).trim($path, '/')); |
|
| 279 | 279 | |
| 280 | 280 | return empty($query) ? $uri : $uri->withQuery(http_build_query($query)); |
| 281 | 281 | } |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | $template = preg_replace('/<(\w+):?.*?>/', '<\1>', $this->pattern); |
| 397 | 397 | |
| 398 | 398 | $this->compiled = [ |
| 399 | - 'pattern' => '/^' . strtr($template, $replaces) . '$/iu', |
|
| 399 | + 'pattern' => '/^'.strtr($template, $replaces).'$/iu', |
|
| 400 | 400 | 'template' => stripslashes(str_replace('?', '', $template)), |
| 401 | 401 | 'options' => array_fill_keys($options, null) |
| 402 | 402 | ]; |
@@ -414,11 +414,11 @@ discard block |
||
| 414 | 414 | $path = $request->getUri()->getPath(); |
| 415 | 415 | |
| 416 | 416 | if (empty($path) || $path[0] !== '/') { |
| 417 | - $path = '/' . $path; |
|
| 417 | + $path = '/'.$path; |
|
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | if ($this->withHost) { |
| 421 | - $uri = $request->getUri()->getHost() . $path; |
|
| 421 | + $uri = $request->getUri()->getHost().$path; |
|
| 422 | 422 | } else { |
| 423 | 423 | $uri = substr($path, strlen($this->prefix)); |
| 424 | 424 | } |