@@ -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 | } |
@@ -67,6 +67,6 @@ |
||
| 67 | 67 | protected function defineAction(Request $request, array $parameters, string $action = null) |
| 68 | 68 | { |
| 69 | 69 | //methodAction [putPost, getPost] |
| 70 | - return strtolower($request->getMethod()) . ucfirst($action); |
|
| 70 | + return strtolower($request->getMethod()).ucfirst($action); |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | \ No newline at end of file |
@@ -131,14 +131,14 @@ discard block |
||
| 131 | 131 | * Default directories pattern, you can overwrite any directory you want in index file. |
| 132 | 132 | */ |
| 133 | 133 | $this->directories = $directories + [ |
| 134 | - 'framework' => dirname(__DIR__) . '/', |
|
| 135 | - 'public' => $directories['root'] . 'webroot/', |
|
| 136 | - 'config' => $directories['application'] . 'config/', |
|
| 137 | - 'views' => $directories['application'] . 'views/', |
|
| 138 | - 'runtime' => $directories['application'] . 'runtime/', |
|
| 139 | - 'cache' => $directories['application'] . 'runtime/cache/', |
|
| 140 | - 'resources' => $directories['application'] . 'resources/', |
|
| 141 | - 'locales' => $directories['application'] . 'resources/locales/' |
|
| 134 | + 'framework' => dirname(__DIR__).'/', |
|
| 135 | + 'public' => $directories['root'].'webroot/', |
|
| 136 | + 'config' => $directories['application'].'config/', |
|
| 137 | + 'views' => $directories['application'].'views/', |
|
| 138 | + 'runtime' => $directories['application'].'runtime/', |
|
| 139 | + 'cache' => $directories['application'].'runtime/cache/', |
|
| 140 | + 'resources' => $directories['application'].'resources/', |
|
| 141 | + 'locales' => $directories['application'].'resources/locales/' |
|
| 142 | 142 | ]; |
| 143 | 143 | |
| 144 | 144 | //Every application needs timezone to be set, by default we are using UTC |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | public function setDirectory(string $alias, string $path): DirectoriesInterface |
| 199 | 199 | { |
| 200 | - $this->directories[$alias] = rtrim($path, '/\\') . '/'; |
|
| 200 | + $this->directories[$alias] = rtrim($path, '/\\').'/'; |
|
| 201 | 201 | |
| 202 | 202 | return $this; |
| 203 | 203 | } |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | * Default spiral environment is based on .env file. |
| 450 | 450 | */ |
| 451 | 451 | $environment = new DotenvEnvironment( |
| 452 | - $core->directory('root') . '.env', |
|
| 452 | + $core->directory('root').'.env', |
|
| 453 | 453 | $core->memory |
| 454 | 454 | ); |
| 455 | 455 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | if ( |
| 87 | 87 | !empty($this->memory) |
| 88 | - && !empty($values = $this->memory->loadData(static::MEMORY . '.' . $this->id)) |
|
| 88 | + && !empty($values = $this->memory->loadData(static::MEMORY.'.'.$this->id)) |
|
| 89 | 89 | ) { |
| 90 | 90 | //Restore from cache |
| 91 | 91 | $this->initEnvironment($values); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $this->initEnvironment($values); |
| 99 | 99 | |
| 100 | 100 | if (!empty($this->memory)) { |
| 101 | - $this->memory->saveData(static::MEMORY . '.' . $this->id, $values); |
|
| 101 | + $this->memory->saveData(static::MEMORY.'.'.$this->id, $values); |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
@@ -167,7 +167,7 @@ |
||
| 167 | 167 | $signature = ''; |
| 168 | 168 | |
| 169 | 169 | foreach ($this->config->signHeaders() as $header) { |
| 170 | - $signature .= $request->getHeaderLine($header) . ';'; |
|
| 170 | + $signature .= $request->getHeaderLine($header).';'; |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | return hash('sha256', $signature); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function reportingDirectory(): string |
| 65 | 65 | { |
| 66 | - return rtrim($this->config['reporting']['directory'], '/') . '/'; |
|
| 66 | + return rtrim($this->config['reporting']['directory'], '/').'/'; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -91,6 +91,6 @@ discard block |
||
| 91 | 91 | 'name' => $name |
| 92 | 92 | ]); |
| 93 | 93 | |
| 94 | - return $this->reportingDirectory() . $filename; |
|
| 94 | + return $this->reportingDirectory().$filename; |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | \ No newline at end of file |
@@ -103,11 +103,11 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | foreach ($this->namespaces[$namespace] as $directory) { |
| 105 | 105 | //Seeking for view filename |
| 106 | - if ($this->files->exists($directory . $filename)) { |
|
| 106 | + if ($this->files->exists($directory.$filename)) { |
|
| 107 | 107 | |
| 108 | 108 | //Found view context |
| 109 | 109 | $this->sourceCache[$path] = new ViewSource( |
| 110 | - $directory . $filename, |
|
| 110 | + $directory.$filename, |
|
| 111 | 111 | $this->fetchName($filename), |
| 112 | 112 | $namespace |
| 113 | 113 | ); |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | if (strpos($filename, '.') === false && !empty($this->extension)) { |
| 157 | 157 | //Forcing default extension |
| 158 | - $filename .= '.' . $this->extension; |
|
| 158 | + $filename .= '.'.$this->extension; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | if (strpos($filename, ViewsInterface::NS_SEPARATOR) !== false) { |