Passed
Push — master ( 2e3c52...e9175e )
by Mehmet
03:49
created
src/Router.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         string $method,
135 135
         string $requestedPath,
136 136
         string $folder = '',
137
-        ?string $cachedFile = null
137
+        ? string $cachedFile = null
138 138
     ) {
139 139
         if (!in_array($method, self::$validRequestMethods, true)) {
140 140
             $message = sprintf('%s is not valid Http request method.', $method);
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
      * @throws InvalidArgumentException
174 174
      * @throws UnexpectedValueException
175 175
      */
176
-    public function add($requestMethods, string $route, string $action, ?string $returnType = null, ?string $alias = null)
176
+    public function add($requestMethods, string $route, string $action, ? string $returnType = null, ? string $alias = null)
177 177
     {
178 178
         $requestMethodsGiven = is_array($requestMethods) ? (array) $requestMethods : [0 => $requestMethods];
179 179
         $returnType = $this->determineReturnType($returnType);
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
      * @param string|null $returnType
212 212
      * @return string
213 213
      */
214
-    private function determineReturnType(?string $returnType) : string
214
+    private function determineReturnType(? string $returnType) : string
215 215
     {
216 216
         if ($returnType === null) {
217 217
             return $this->defaultReturnType;
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
             $this->cachedFile,
303 303
             '<?php return ' . var_export($dispatchData, true) . ';'
304 304
         );
305
-        return new $options['dispatcher']($dispatchData );
305
+        return new $options['dispatcher']($dispatchData);
306 306
     }
307 307
 
308 308
     /**
@@ -311,10 +311,10 @@  discard block
 block discarded – undo
311 311
      */
312 312
     private function addRoutes(FastRoute\RouteCollector $route) : void
313 313
     {
314
-        $routeIndex=0;
314
+        $routeIndex = 0;
315 315
         foreach ($this->routes as $definedRoute) {
316 316
             $definedRoute[3] = $definedRoute[3] ?? $this->defaultReturnType;
317
-            $routeName = 'routeClosure'.$routeIndex;
317
+            $routeName = 'routeClosure' . $routeIndex;
318 318
             [$null1, $null2, $controller, $returnType] = $definedRoute;
319 319
             $returnType = Router::$translations[$returnType] ?? $this->defaultReturnType;
320 320
             $this->routerClosures[$routeName] = function($args) use ($controller, $returnType) {
Please login to merge, or discard this patch.