@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public function header($name, $value) |
72 | 72 | { |
73 | 73 | if (!empty($name) && !empty($value) && !headers_sent()) { |
74 | - header($name . ': ' . $value); |
|
74 | + header($name.': '.$value); |
|
75 | 75 | return true; |
76 | 76 | } |
77 | 77 | return false; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $statusTexts = [ |
112 | 112 | 100 => 'Continue', |
113 | 113 | 101 => 'Switching Protocols', |
114 | - 102 => 'Processing', // RFC2518 |
|
114 | + 102 => 'Processing', // RFC2518 |
|
115 | 115 | 200 => 'OK', |
116 | 116 | 201 => 'Created', |
117 | 117 | 202 => 'Accepted', |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | 204 => 'No Content', |
120 | 120 | 205 => 'Reset Content', |
121 | 121 | 206 => 'Partial Content', |
122 | - 207 => 'Multi-Status', // RFC4918 |
|
123 | - 208 => 'Already Reported', // RFC5842 |
|
124 | - 226 => 'IM Used', // RFC3229 |
|
122 | + 207 => 'Multi-Status', // RFC4918 |
|
123 | + 208 => 'Already Reported', // RFC5842 |
|
124 | + 226 => 'IM Used', // RFC3229 |
|
125 | 125 | 300 => 'Multiple Choices', |
126 | 126 | 301 => 'Moved Permanently', |
127 | 127 | 302 => 'Found', |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | 304 => 'Not Modified', |
130 | 130 | 305 => 'Use Proxy', |
131 | 131 | 307 => 'Temporary Redirect', |
132 | - 308 => 'Permanent Redirect', // RFC7238 |
|
132 | + 308 => 'Permanent Redirect', // RFC7238 |
|
133 | 133 | 400 => 'Bad Request', |
134 | 134 | 401 => 'Unauthorized', |
135 | 135 | 402 => 'Payment Required', |
@@ -148,26 +148,26 @@ discard block |
||
148 | 148 | 415 => 'Unsupported Media Type', |
149 | 149 | 416 => 'Range Not Satisfiable', |
150 | 150 | 417 => 'Expectation Failed', |
151 | - 418 => 'I\'m a teapot', // RFC2324 |
|
152 | - 422 => 'Unprocessable Entity', // RFC4918 |
|
153 | - 423 => 'Locked', // RFC4918 |
|
154 | - 424 => 'Failed Dependency', // RFC4918 |
|
155 | - 425 => 'Reserved for WebDAV advanced collections expired proposal', // RFC2817 |
|
156 | - 426 => 'Upgrade Required', // RFC2817 |
|
157 | - 428 => 'Precondition Required', // RFC6585 |
|
158 | - 429 => 'Too Many Requests', // RFC6585 |
|
159 | - 431 => 'Request Header Fields Too Large', // RFC6585 |
|
151 | + 418 => 'I\'m a teapot', // RFC2324 |
|
152 | + 422 => 'Unprocessable Entity', // RFC4918 |
|
153 | + 423 => 'Locked', // RFC4918 |
|
154 | + 424 => 'Failed Dependency', // RFC4918 |
|
155 | + 425 => 'Reserved for WebDAV advanced collections expired proposal', // RFC2817 |
|
156 | + 426 => 'Upgrade Required', // RFC2817 |
|
157 | + 428 => 'Precondition Required', // RFC6585 |
|
158 | + 429 => 'Too Many Requests', // RFC6585 |
|
159 | + 431 => 'Request Header Fields Too Large', // RFC6585 |
|
160 | 160 | 500 => 'Internal Server Error', |
161 | 161 | 501 => 'Not Implemented', |
162 | 162 | 502 => 'Bad Gateway', |
163 | 163 | 503 => 'Service Unavailable', |
164 | 164 | 504 => 'Gateway Timeout', |
165 | 165 | 505 => 'HTTP Version Not Supported', |
166 | - 506 => 'Variant Also Negotiates (Experimental)', // RFC2295 |
|
167 | - 507 => 'Insufficient Storage', // RFC4918 |
|
168 | - 508 => 'Loop Detected', // RFC5842 |
|
169 | - 510 => 'Not Extended', // RFC2774 |
|
170 | - 511 => 'Network Authentication Required', // RFC6585 |
|
166 | + 506 => 'Variant Also Negotiates (Experimental)', // RFC2295 |
|
167 | + 507 => 'Insufficient Storage', // RFC4918 |
|
168 | + 508 => 'Loop Detected', // RFC5842 |
|
169 | + 510 => 'Not Extended', // RFC2774 |
|
170 | + 511 => 'Network Authentication Required', // RFC6585 |
|
171 | 171 | ]; |
172 | 172 | $statusText = $statusTexts[$statusCode]; |
173 | 173 | } |
@@ -189,13 +189,13 @@ discard block |
||
189 | 189 | { |
190 | 190 | $server = filter_input_array(INPUT_SERVER); |
191 | 191 | if (null === $url && isset($server['REQUEST_URI'])) { |
192 | - $url = '/' . trim($server['REQUEST_URI'], '/'); |
|
192 | + $url = '/'.trim($server['REQUEST_URI'], '/'); |
|
193 | 193 | preg_match('/^[\\a-zA-Z0-9-\._~:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=%]*$/iD', $url, $match); |
194 | 194 | $url = $match[1] ?? ''; |
195 | 195 | } |
196 | 196 | |
197 | 197 | if (!headers_sent()) { |
198 | - header('Location: ' . $url, true, $statusCode); |
|
198 | + header('Location: '.$url, true, $statusCode); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | echo sprintf('<!DOCTYPE html> |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | { |
49 | 49 | if (false === strpos($name, '.')) { |
50 | 50 | if (!empty($name)) { |
51 | - $name = '.' . $name; |
|
51 | + $name = '.'.$name; |
|
52 | 52 | } |
53 | - $name = 'view' . $name . '.html.php'; |
|
53 | + $name = 'view'.$name.'.html.php'; |
|
54 | 54 | $this->routeView = true; |
55 | 55 | } |
56 | - $path = $this->packageRoot . '/view/_cache/' . str_replace('/', '_', $name); |
|
56 | + $path = $this->packageRoot.'/view/_cache/'.str_replace('/', '_', $name); |
|
57 | 57 | |
58 | 58 | if (!file_exists($path) || !$this->cache) { |
59 | 59 | $code = $this->compile($name, true, true); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function clearCache() |
108 | 108 | { |
109 | - self::removeFromDir($this->packageRoot . '/view/_cache'); |
|
109 | + self::removeFromDir($this->packageRoot.'/view/_cache'); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -127,13 +127,13 @@ discard block |
||
127 | 127 | $path = ''; |
128 | 128 | $stack = debug_backtrace(); |
129 | 129 | foreach ($stack as $item) { |
130 | - if (false !== stripos($item['file'], DIRECTORY_SEPARATOR . 'Route' . DIRECTORY_SEPARATOR)) { |
|
131 | - $path = pathinfo($item['file'], PATHINFO_DIRNAME) . '/' . $name; |
|
130 | + if (false !== stripos($item['file'], DIRECTORY_SEPARATOR.'Route'.DIRECTORY_SEPARATOR)) { |
|
131 | + $path = pathinfo($item['file'], PATHINFO_DIRNAME).'/'.$name; |
|
132 | 132 | break; |
133 | 133 | } |
134 | 134 | } |
135 | 135 | } else { |
136 | - $path = $this->packageRoot . '/view/' . $name; |
|
136 | + $path = $this->packageRoot.'/view/'.$name; |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | if (file_exists($path)) { |