Passed
Push — 0.7.0 ( f20096...1a66e7 )
by Alexander
03:34 queued 10s
created
src/components/Routing/Concerns/RouteDependencyResolver.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
      */
118 118
     protected function getInParameters($class, array $parameters)
119 119
     {
120
-        return ! is_null(Arr::first($parameters, function ($value) use ($class) {
120
+        return ! is_null(Arr::first($parameters, function($value) use ($class) {
121 121
             return $value instanceof $class;
122 122
         }));
123 123
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@
 block discarded – undo
79 79
                 $count++;
80 80
 
81 81
                 $this->spliceOnParameters($parameters, $key, $instance);
82
-            }
83
-            elseif ( ! isset($values[$key - $count]) && $parameter->isDefaultValueAvailable())
82
+            } elseif ( ! isset($values[$key - $count]) && $parameter->isDefaultValueAvailable())
84 83
             {
85 84
                 $this->spliceOnParameters($parameters, $key, $parameter->getDefaultValue());
86 85
             }            
Please login to merge, or discard this patch.
src/components/Routing/Concerns/RouteResolver.php 3 patches
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -38,99 +38,99 @@
 block discarded – undo
38 38
  */
39 39
 trait RouteResolver
40 40
 {
41
-	/**
42
-	 * The currently dispatched route instance.
43
-	 * 
44
-	 * @var \Syscodes\Routing\Route|null
45
-	 */
46
-	protected $current;
41
+    /**
42
+     * The currently dispatched route instance.
43
+     * 
44
+     * @var \Syscodes\Routing\Route|null
45
+     */
46
+    protected $current;
47 47
 
48
-	/**
49
-	 * Resolve the given route and call the method that belongs to the route.
50
-	 *
51
-	 * @param  \Syscodes\Http\Request  $request
52
-	 * @param  \Syscodes\Routing\RouteCollection  $route 
53
-	 *
54
-	 * @return \Syscodes\Http\Response
55
-	 */
56
-	public function resolve($request, Routecollection $route)
57
-	{
58
-		return $this->dispatchToRoute($request, $route);
59
-	}
48
+    /**
49
+     * Resolve the given route and call the method that belongs to the route.
50
+     *
51
+     * @param  \Syscodes\Http\Request  $request
52
+     * @param  \Syscodes\Routing\RouteCollection  $route 
53
+     *
54
+     * @return \Syscodes\Http\Response
55
+     */
56
+    public function resolve($request, Routecollection $route)
57
+    {
58
+        return $this->dispatchToRoute($request, $route);
59
+    }
60 60
 
61
-	/**
62
-	 * Dispatch the request to a route and return the response.
63
-	 * 
64
-	 * @param  \Syscodes\Http\Request  $request
65
-	 * @param  \Syscodes\Routing\RouteCollection  $route 
66
-	 *
67
-	 * @return \Syscodes\Http\Response
68
-	 */
69
-	protected function dispatchToRoute($request, $route)
70
-	{
71
-		return $this->runRoute($request, 
72
-			$this->findRoute($request, $route)
73
-		);
74
-	}
61
+    /**
62
+     * Dispatch the request to a route and return the response.
63
+     * 
64
+     * @param  \Syscodes\Http\Request  $request
65
+     * @param  \Syscodes\Routing\RouteCollection  $route 
66
+     *
67
+     * @return \Syscodes\Http\Response
68
+     */
69
+    protected function dispatchToRoute($request, $route)
70
+    {
71
+        return $this->runRoute($request, 
72
+            $this->findRoute($request, $route)
73
+        );
74
+    }
75 75
 
76
-	/**
77
-	 * Return the response for the given route.
78
-	 * 
79
-	 * @param  \Syscodes\Http\Request  $request
80
-	 * @param  \Syscodes\Routing\Route  $route
81
-	 * 
82
-	 * @return \Syscodes\Http\Response 
83
-	 */
84
-	protected function runRoute($request, $route)
85
-	{		
86
-		return (new Pipeline($this->container))
87
-				->send($request)
88
-				->then(function ($request) use ($route) {
89
-					return $this->callResponse(
90
-						$request, $route->runResolver()
91
-					); 
92
-				});
93
-	}
76
+    /**
77
+     * Return the response for the given route.
78
+     * 
79
+     * @param  \Syscodes\Http\Request  $request
80
+     * @param  \Syscodes\Routing\Route  $route
81
+     * 
82
+     * @return \Syscodes\Http\Response 
83
+     */
84
+    protected function runRoute($request, $route)
85
+    {		
86
+        return (new Pipeline($this->container))
87
+                ->send($request)
88
+                ->then(function ($request) use ($route) {
89
+                    return $this->callResponse(
90
+                        $request, $route->runResolver()
91
+                    ); 
92
+                });
93
+    }
94 94
 
95
-	/**
96
-	 * Create a response instance from the given value.
97
-	 * 
98
-	 * @param  \Syscodes\Http\Request  $request
99
-	 * @param  mixed  $response
100
-	 * 
101
-	 * @return \Syscodes\Http\Response
102
-	 */
103
-	protected function callResponse($request, $response)
104
-	{
105
-		if ( ! $response instanceof Response && 
106
-		      ($response instanceof Jsonserializable || 
107
-			   is_array($response)))
108
-		{
109
-			$response = new JsonResponse($response);
110
-		}
111
-		elseif ( ! $response instanceof Response)
112
-		{
113
-			$response = new Response($response, 200, ['Content-Type' => 'text/html']);
114
-		}
95
+    /**
96
+     * Create a response instance from the given value.
97
+     * 
98
+     * @param  \Syscodes\Http\Request  $request
99
+     * @param  mixed  $response
100
+     * 
101
+     * @return \Syscodes\Http\Response
102
+     */
103
+    protected function callResponse($request, $response)
104
+    {
105
+        if ( ! $response instanceof Response && 
106
+              ($response instanceof Jsonserializable || 
107
+               is_array($response)))
108
+        {
109
+            $response = new JsonResponse($response);
110
+        }
111
+        elseif ( ! $response instanceof Response)
112
+        {
113
+            $response = new Response($response, 200, ['Content-Type' => 'text/html']);
114
+        }
115 115
 
116
-		return $response->prepare($request);
117
-	}
116
+        return $response->prepare($request);
117
+    }
118 118
 
119
-	/**
120
-	 * Find the route matching a given request.
121
-	 * 
122
-	 * @param  \Syscodes\Http\Request  $request
123
-	 * @param  \Syscodes\Routing\RouteCollection  $route
124
-	 * 
125
-	 * @return \Syscodes\Routing\Route
126
-	 */
127
-	protected function findRoute($request, $route)
128
-	{
129
-		// Get all register routes with the same request method
130
-		$this->current = $route = $route->match($request);
119
+    /**
120
+     * Find the route matching a given request.
121
+     * 
122
+     * @param  \Syscodes\Http\Request  $request
123
+     * @param  \Syscodes\Routing\RouteCollection  $route
124
+     * 
125
+     * @return \Syscodes\Routing\Route
126
+     */
127
+    protected function findRoute($request, $route)
128
+    {
129
+        // Get all register routes with the same request method
130
+        $this->current = $route = $route->match($request);
131 131
 
132
-		$this->container->instance(Route::class, $route);
132
+        $this->container->instance(Route::class, $route);
133 133
 
134
-		return $route;
135
-	}
134
+        return $route;
135
+    }
136 136
 }
137 137
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
 	{		
86 86
 		return (new Pipeline($this->container))
87 87
 				->send($request)
88
-				->then(function ($request) use ($route) {
88
+				->then(function($request) use ($route) {
89 89
 					return $this->callResponse(
90 90
 						$request, $route->runResolver()
91 91
 					); 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,8 +107,7 @@
 block discarded – undo
107 107
 			   is_array($response)))
108 108
 		{
109 109
 			$response = new JsonResponse($response);
110
-		}
111
-		elseif ( ! $response instanceof Response)
110
+		} elseif ( ! $response instanceof Response)
112 111
 		{
113 112
 			$response = new Response($response, 200, ['Content-Type' => 'text/html']);
114 113
 		}
Please login to merge, or discard this patch.
src/components/Routing/RouteCollection.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@
 block discarded – undo
61 61
     protected $nameList = [];
62 62
 
63 63
     /**
64
-	 * The Route instance.
65
-	 * 
66
-	 * @var \Syscodes\Routing\Route|null
67
-	 */
68
-	protected $route;
64
+     * The Route instance.
65
+     * 
66
+     * @var \Syscodes\Routing\Route|null
67
+     */
68
+    protected $route;
69 69
 
70 70
     /**
71 71
      * An array of the routes keyed by method.
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -290,7 +290,7 @@
 block discarded – undo
290 290
      */
291 291
     protected function regexUri(string $route)
292 292
     {
293
-        return preg_replace_callback('~\{([^/]+)\}~', function (array $match) {
293
+        return preg_replace_callback('~\{([^/]+)\}~', function(array $match) {
294 294
             return $this->regexParameter($match[1]);
295 295
         }, $route);
296 296
     }
Please login to merge, or discard this patch.
src/components/Routing/RouteAction.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     protected static function usesAction($uri)
78 78
     {
79
-        return ['uses' => function () use ($uri) {
79
+        return ['uses' => function() use ($uri) {
80 80
             throw new LogicException(__('route.hasNoAction', ['uri' => $uri]));
81 81
         }];
82 82
     }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      */
91 91
     protected static function findClosureAction(array $action)
92 92
     {
93
-        return Arr::first($action, function ($value, $key) {
93
+        return Arr::first($action, function($value, $key) {
94 94
             return is_callable($value) && is_numeric($key);
95 95
         });
96 96
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@
 block discarded – undo
56 56
                     'uses' => $action[0].'@'.$action[1],
57 57
                     'controller' => $action[0].'@'.$action[1],
58 58
             ];
59
-        }
60
-        elseif ( ! isset($action['uses']))
59
+        } elseif ( ! isset($action['uses']))
61 60
         {
62 61
             $action['uses'] = static::findClosureAction($action);
63 62
         }
Please login to merge, or discard this patch.
src/components/Routing/RouteParamBinding.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
 
98 98
         $parameters = array_intersect_key($matches, array_values($parameterNames));
99 99
         
100
-        return array_filter($parameters, function ($value) 
100
+        return array_filter($parameters, function($value) 
101 101
         {
102 102
             return (is_string($value) && strlen($value) > 0);
103 103
         });
Please login to merge, or discard this patch.
src/components/Routing/ResourceRegister.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -347,7 +347,7 @@
 block discarded – undo
347 347
      */
348 348
     protected function getNestedResourceUri(array $segments)
349 349
     {
350
-        return implode('/', array_map(function ($segment) 
350
+        return implode('/', array_map(function($segment) 
351 351
         {
352 352
             return $segment.'/{'.$this->getResourceWilcard($segment).'}';
353 353
         }, $segments));
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -173,8 +173,7 @@  discard block
 block discarded – undo
173 173
         if (isset($options['only']))
174 174
         {
175 175
             return array_intersect($defaults, (array) $options['only']);
176
-        }
177
-        elseif (isset($options['except']))
176
+        } elseif (isset($options['except']))
178 177
         {
179 178
             return array_diff($defaults, (array) $options['except']);
180 179
         }
@@ -391,8 +390,7 @@  discard block
 block discarded – undo
391 390
             if (is_string($options['names']))
392 391
             {
393 392
                 $resource = $options['names'];
394
-            }
395
-            elseif (isset($options['names'][$method]))
393
+            } elseif (isset($options['names'][$method]))
396 394
             {
397 395
                 return $options['names'][$method];
398 396
             }
@@ -444,8 +442,7 @@  discard block
 block discarded – undo
444 442
         if (empty($verbs))
445 443
         {
446 444
             return static::$verbs;
447
-        }
448
-        else
445
+        } else
449 446
         {
450 447
             static::$verbs = array_merge(static::$verbs, $verbs);
451 448
         }
Please login to merge, or discard this patch.
src/components/Contracts/Routing/Routable.php 1 patch
Indentation   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -31,94 +31,94 @@
 block discarded – undo
31 31
  */
32 32
 interface Routable
33 33
 {
34
-	/**
35
-	 * Add a route for all posible methods.
36
-	 *
37
-	 * @param  string  $route
38
-	 * @param  \Closure|array|string  $action
39
-	 *
40
-	 * @return void
41
-	 */
42
-	public function any($route, $action);
34
+    /**
35
+     * Add a route for all posible methods.
36
+     *
37
+     * @param  string  $route
38
+     * @param  \Closure|array|string  $action
39
+     *
40
+     * @return void
41
+     */
42
+    public function any($route, $action);
43 43
 
44
-	/**
45
-	 * Add a route with delete method.
46
-	 *
47
-	 * @param  string  $route
48
-	 * @param  \Closure|array|string  $action
49
-	 *
50
-	 * @return void
51
-	 */
52
-	public function delete($route, $action);
44
+    /**
45
+     * Add a route with delete method.
46
+     *
47
+     * @param  string  $route
48
+     * @param  \Closure|array|string  $action
49
+     *
50
+     * @return void
51
+     */
52
+    public function delete($route, $action);
53 53
 
54
-	/**
55
-	 * Add a route with get method.
56
-	 * 
57
-	 * @param  string  $route
58
-	 * @param  \Closure|array|string  $action
59
-	 *
60
-	 * @return void
61
-	 */
62
-	public function get($route, $action);
54
+    /**
55
+     * Add a route with get method.
56
+     * 
57
+     * @param  string  $route
58
+     * @param  \Closure|array|string  $action
59
+     *
60
+     * @return void
61
+     */
62
+    public function get($route, $action);
63 63
 
64
-	/**
65
-	 * Add a route with head method.
66
-	 *
67
-	 * @param  string  $route
68
-	 * @param  \Closure|array|string  $action
69
-	 *
70
-	 * @return void
71
-	 */
72
-	public function head($route, $action);
64
+    /**
65
+     * Add a route with head method.
66
+     *
67
+     * @param  string  $route
68
+     * @param  \Closure|array|string  $action
69
+     *
70
+     * @return void
71
+     */
72
+    public function head($route, $action);
73 73
 
74
-	/**
75
-	 * Add a route with options method
76
-	 *
77
-	 * @param  string  $route
78
-	 * @param  \Closure|array|string  $action
79
-	 *
80
-	 * @return void
81
-	 */
82
-	public function options($route, $action);
74
+    /**
75
+     * Add a route with options method
76
+     *
77
+     * @param  string  $route
78
+     * @param  \Closure|array|string  $action
79
+     *
80
+     * @return void
81
+     */
82
+    public function options($route, $action);
83 83
 
84
-	/**
85
-	 * Add a route with patch method.
86
-	 *
87
-	 * @param  string  $route
88
-	 * @param  \Closure|array|string  $action
89
-	 *
90
-	 * @return void
91
-	 */
92
-	public function patch($route, $action);
84
+    /**
85
+     * Add a route with patch method.
86
+     *
87
+     * @param  string  $route
88
+     * @param  \Closure|array|string  $action
89
+     *
90
+     * @return void
91
+     */
92
+    public function patch($route, $action);
93 93
 
94
-	/**
95
-	 * Add a route with post method.
96
-	 *
97
-	 * @param  string  $route
98
-	 * @param  \Closure|array|string  $action
99
-	 *
100
-	 * @return void
101
-	 */
102
-	public function post($route, $action);
94
+    /**
95
+     * Add a route with post method.
96
+     *
97
+     * @param  string  $route
98
+     * @param  \Closure|array|string  $action
99
+     *
100
+     * @return void
101
+     */
102
+    public function post($route, $action);
103 103
 
104
-	/**
105
-	 * Add a route with put method.
106
-	 *
107
-	 * @param  string  $route
108
-	 * @param  \Closure|array|string  $action
109
-	 *
110
-	 * @return void
111
-	 */
112
-	public function put($route, $action);
104
+    /**
105
+     * Add a route with put method.
106
+     *
107
+     * @param  string  $route
108
+     * @param  \Closure|array|string  $action
109
+     *
110
+     * @return void
111
+     */
112
+    public function put($route, $action);
113 113
 
114
-	/**
115
-	 * Group a series of routes under a single URL segment. This is handy
116
-	 * for grouping items into an admin area.
117
-	 * 
118
-	 * @param  array  $attributes
119
-	 * @param  \Closure|string  $callback
120
-	 *
121
-	 * @return void
122
-	 */
123
-	public function group(array $attributes, $parameters);
114
+    /**
115
+     * Group a series of routes under a single URL segment. This is handy
116
+     * for grouping items into an admin area.
117
+     * 
118
+     * @param  array  $attributes
119
+     * @param  \Closure|string  $callback
120
+     *
121
+     * @return void
122
+     */
123
+    public function group(array $attributes, $parameters);
124 124
 }
125 125
\ No newline at end of file
Please login to merge, or discard this patch.
src/components/Contracts/Console/Application.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -30,19 +30,19 @@
 block discarded – undo
30 30
  */
31 31
 interface Application
32 32
 {
33
-	/**
34
-	 * Runs the current command discovered on the CLI.
35
-	 * 
36
-	 * @return void
37
-	 */	
38
-	public function run();
33
+    /**
34
+     * Runs the current command discovered on the CLI.
35
+     * 
36
+     * @return void
37
+     */	
38
+    public function run();
39 39
 	
40
-	/**
41
-	 * Displays basic information about the Console.
42
-	 * 
43
-	 * @return void
44
-	 * 
45
-	 * @uses   Version::RELEASE
46
-	 */ 
47
-	public function showHeader(); 
40
+    /**
41
+     * Displays basic information about the Console.
42
+     * 
43
+     * @return void
44
+     * 
45
+     * @uses   Version::RELEASE
46
+     */ 
47
+    public function showHeader(); 
48 48
 }
49 49
\ No newline at end of file
Please login to merge, or discard this patch.
src/components/Contracts/View/Factory.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@
 block discarded – undo
31 31
 interface Factory
32 32
 {
33 33
     /**
34
-	 * Check existance view file.
35
-	 * 
36
-	 * @param  string  $view
37
-	 *
38
-	 * @return bool
39
-	 */
34
+     * Check existance view file.
35
+     * 
36
+     * @param  string  $view
37
+     *
38
+     * @return bool
39
+     */
40 40
     public function viewExists($view);
41 41
 
42 42
     /**
Please login to merge, or discard this patch.