@@ -341,9 +341,9 @@ discard block |
||
341 | 341 | if (!empty($currentRoute)) { |
342 | 342 | $currentRoute = current($currentRoute); |
343 | 343 | $foundRoute = true; |
344 | - $this->runRouteMiddleware($currentRoute, 'before', $this->request, $this->response); |
|
344 | + $this->runRouteMiddleware($currentRoute, 'before', $this->request, $this->response); |
|
345 | 345 | $this->runRouteCommand($currentRoute['callback']); |
346 | - $this->runRouteMiddleware($currentRoute, 'after', $this->request, $this->response); |
|
346 | + $this->runRouteMiddleware($currentRoute, 'after', $this->request, $this->response); |
|
347 | 347 | } |
348 | 348 | } else { |
349 | 349 | foreach ($this->routes as $data) { |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | if ($this->request->validMethod($data['method'], $method)) { |
357 | 357 | $foundRoute = true; |
358 | 358 | |
359 | - $this->runRouteMiddleware($data, 'before', $this->request, $this->response); |
|
359 | + $this->runRouteMiddleware($data, 'before', $this->request, $this->response); |
|
360 | 360 | |
361 | 361 | array_shift($matched); |
362 | 362 | $matched = array_map(function($value) { |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | }, $matched); |
365 | 365 | |
366 | 366 | $this->runRouteCommand($data['callback'], $matched, $this->request); |
367 | - $this->runRouteMiddleware($data, 'after', $this->request, $this->response); |
|
367 | + $this->runRouteMiddleware($data, 'after', $this->request, $this->response); |
|
368 | 368 | break; |
369 | 369 | } |
370 | 370 | } |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | * |
397 | 397 | * @return bool |
398 | 398 | */ |
399 | - public function group($settings = null, $callback = null, $name =null) |
|
399 | + public function group($settings = null, $callback = null, $name = null) |
|
400 | 400 | { |
401 | 401 | if ($this->cacheLoaded) { |
402 | 402 | return true; |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | $this->criateRoute($route, $groupItem, $method, $callback, $settings); |
557 | 557 | } |
558 | 558 | |
559 | - private function criateRoute($route, $groupItem, $method, $callback, $settings){ |
|
559 | + private function criateRoute($route, $groupItem, $method, $callback, $settings) { |
|
560 | 560 | $routeName = is_string($callback) |
561 | 561 | ? strtolower(preg_replace( |
562 | 562 | '/[^\w]/i', '/', str_replace($this->namespaces['controllers'], '', $callback) |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | public function __construct(ResizeInterface $image, string $filename = 'archive') |
104 | 104 | { |
105 | 105 | if (!empty($_FILES[$filename])) { |
106 | - if(is_array( $_FILES[$filename]['name'])){ |
|
106 | + if (is_array($_FILES[$filename]['name'])) { |
|
107 | 107 | foreach ($_FILES[$filename]['name'] as $i => $name) { |
108 | 108 | $this->name = $_FILES[$filename]['name'][$i]; |
109 | 109 | $this->size = $_FILES[$filename]['size'][$i]; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | $this->explode = explode('.', $this->name); |
114 | 114 | } |
115 | - }else { |
|
115 | + } else { |
|
116 | 116 | $this->name = $_FILES[$filename]['name']; |
117 | 117 | $this->size = $_FILES[$filename]['size']; |
118 | 118 | $this->type = $_FILES[$filename]['type']; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * make PathDir If User Exist |
133 | 133 | * @param string $userNamePath |
134 | 134 | */ |
135 | - public function file($dir_name = null, $userNamePath= null) |
|
135 | + public function file($dir_name = null, $userNamePath = null) |
|
136 | 136 | { |
137 | 137 | $this->dir = $dir_name; |
138 | 138 | $this->userNamePath = $userNamePath; |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | private function make() |
147 | 147 | { |
148 | - if ( null == $this->userNamePath ) { |
|
148 | + if (null == $this->userNamePath) { |
|
149 | 149 | $this->makeDefaultPath(); |
150 | 150 | $this->makePathDirIfDefaultFileNotExist(); |
151 | 151 | return $this->moveUploadedFile(); |
@@ -112,7 +112,7 @@ |
||
112 | 112 | |
113 | 113 | $this->explode = explode('.', $this->name); |
114 | 114 | } |
115 | - }else { |
|
115 | + } else { |
|
116 | 116 | $this->name = $_FILES[$filename]['name']; |
117 | 117 | $this->size = $_FILES[$filename]['size']; |
118 | 118 | $this->type = $_FILES[$filename]['type']; |
@@ -143,10 +143,10 @@ |
||
143 | 143 | return $headers; |
144 | 144 | } |
145 | 145 | |
146 | - /** |
|
147 | - * This static method will create a new Request object, based on the |
|
148 | - * current PHP request. |
|
149 | - */ |
|
146 | + /** |
|
147 | + * This static method will create a new Request object, based on the |
|
148 | + * current PHP request. |
|
149 | + */ |
|
150 | 150 | public static function getRequest(): RequestBuilder |
151 | 151 | { |
152 | 152 | $serverArr = $_SERVER; |
@@ -166,13 +166,13 @@ discard block |
||
166 | 166 | */ |
167 | 167 | public static function sendResponse(Response $response) : Response |
168 | 168 | { |
169 | - header('HTTP/'.$response->getHttpVersion().' '.$response->getStatus().' '.$response->getStatusText()); |
|
169 | + header('HTTP/' . $response->getHttpVersion() . ' ' . $response->getStatus() . ' ' . $response->getStatusText()); |
|
170 | 170 | foreach ($response->getHeaders() as $key => $value) { |
171 | 171 | foreach ($value as $k => $v) { |
172 | 172 | if (0 === $k) { |
173 | - header($key.': '.$v); |
|
173 | + header($key . ': ' . $v); |
|
174 | 174 | } else { |
175 | - header($key.': '.$v, false); |
|
175 | + header($key . ': ' . $v, false); |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 | } |
@@ -225,13 +225,13 @@ discard block |
||
225 | 225 | // (fast)cgi does not usually do this, however. |
226 | 226 | case 'PHP_AUTH_USER': |
227 | 227 | if (isset($serverArray['PHP_AUTH_PW'])) { |
228 | - $headers['Authorization'] = 'Basic '.base64_encode($value.':'.$serverArray['PHP_AUTH_PW']); |
|
228 | + $headers['Authorization'] = 'Basic ' . base64_encode($value . ':' . $serverArray['PHP_AUTH_PW']); |
|
229 | 229 | } |
230 | 230 | break; |
231 | 231 | |
232 | 232 | // Similarly, mod_php may also screw around with digest auth. |
233 | 233 | case 'PHP_AUTH_DIGEST': |
234 | - $headers['Authorization'] = 'Digest '.$value; |
|
234 | + $headers['Authorization'] = 'Digest ' . $value; |
|
235 | 235 | break; |
236 | 236 | |
237 | 237 | // Apache may prefix the HTTP_AUTHORIZATION header with |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $r = new RequestBuilder($method, $url, $headers); |
281 | 281 | $r->setHttpVersion($httpVersion); |
282 | 282 | $r->setRawServerData($serverArray); |
283 | - $r->setAbsoluteUrl($protocol.'://'.$hostName.$url); |
|
283 | + $r->setAbsoluteUrl($protocol . '://' . $hostName . $url); |
|
284 | 284 | |
285 | 285 | return $r; |
286 | 286 | } |