Passed
Push — 0.7.0 ( dc9ed8...371c99 )
by Alexander
03:04 queued 10s
created
src/components/Database/Connectors/PostgresConnector.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -66,13 +66,13 @@
 block discarded – undo
66 66
         return $connection;
67 67
     }
68 68
 
69
-     /**
70
-     * Create a DSN string from a configuration.
71
-     * 
72
-     * @param  array  $config
73
-     * 
74
-     * @return string
75
-     */
69
+        /**
70
+         * Create a DSN string from a configuration.
71
+         * 
72
+         * @param  array  $config
73
+         * 
74
+         * @return string
75
+         */
76 76
     protected function getDsn(array $config)
77 77
     {
78 78
         extract($config, EXTR_SKIP);
Please login to merge, or discard this patch.
src/components/Routing/RouteFileRegister.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,6 @@
 block discarded – undo
41 41
      * Create a new route file registrar instance.
42 42
      *
43 43
      * @param  \Syscodes\Routing\Router  $router
44
-
45 44
      * @return void
46 45
      */
47 46
     public function __construct(Router $router)
Please login to merge, or discard this patch.
src/components/Routing/RoutingServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      */
54 54
     protected function registerRouter()
55 55
     {
56
-        $this->app->singleton('router', function ($app) {
56
+        $this->app->singleton('router', function($app) {
57 57
             return new Router($app);
58 58
         });
59 59
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     protected function registerUrlGenerator()
79 79
     {
80
-        $this->app->singleton('url', function ($app) {
80
+        $this->app->singleton('url', function($app) {
81 81
             
82 82
             $routes = $app['router']->getRoutes();
83 83
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     protected function registerRedirector()
95 95
     {
96
-        $this->app->singleton('redirect', function ($app) {
96
+        $this->app->singleton('redirect', function($app) {
97 97
             return new Redirector($app['url']);
98 98
         });
99 99
     }
Please login to merge, or discard this patch.
src/components/Routing/Route.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
 	* @var array $patterns 
100 100
 	*/
101 101
 	public $patterns = [
102
-		'~/~'                    =>  '\/',               // Slash
103
-		'~{an:[^\/{}]+}~'        => '([0-9a-zA-Z]++)',   // Placeholder accepts alphabetic and numeric chars
104
-		'~{n:[^\/{}]+}~'         => '([0-9]++)',         // Placeholder accepts only numeric
105
-		'~{a:[^\/{}]+}~'         => '([a-zA-Z]++)',      // Placeholder accepts only alphabetic chars
102
+		'~/~'                    =>  '\/', // Slash
103
+		'~{an:[^\/{}]+}~'        => '([0-9a-zA-Z]++)', // Placeholder accepts alphabetic and numeric chars
104
+		'~{n:[^\/{}]+}~'         => '([0-9]++)', // Placeholder accepts only numeric
105
+		'~{a:[^\/{}]+}~'         => '([a-zA-Z]++)', // Placeholder accepts only alphabetic chars
106 106
 		'~{w:[^\/{}]+}~'         => '([0-9a-zA-Z-_]++)', // Placeholder accepts alphanumeric and underscore
107
-		'~{\*:[^\/{}]+}~'        => '(.++)',             // Placeholder match rest of url
108
-		'~(\\\/)?{\?:[^\/{}]+}~' => '\/?([^\/]*)',		 // Optional placeholder
107
+		'~{\*:[^\/{}]+}~'        => '(.++)', // Placeholder match rest of url
108
+		'~(\\\/)?{\?:[^\/{}]+}~' => '\/?([^\/]*)', // Optional placeholder
109 109
 		'~{[^\/{}]+}~'           => '([^\/]++)'			 // Normal placeholder
110 110
 	];
111 111
 
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 	{
609 609
 		preg_match_all('~[^\/\{(.*?)\}]~', $this->domain().$this->uri, $matches);
610 610
 
611
-		return array_map(function ($match) {
611
+		return array_map(function($match) {
612 612
 			return trim($match, '?');
613 613
 		}, $matches[0]);
614 614
 	}
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 	 */
649 649
 	public function parametersWithouNulls()
650 650
 	{
651
-		return array_filter($this->parameters(), function ($parameter) {
651
+		return array_filter($this->parameters(), function($parameter) {
652 652
 			return ! is_null($parameter);
653 653
 		});
654 654
 	}
Please login to merge, or discard this patch.
Indentation   +721 added lines, -721 removed lines patch added patch discarded remove patch
@@ -40,738 +40,738 @@
 block discarded – undo
40 40
  */
41 41
 class Route 
42 42
 {
43
-	use Concerns\RouteCondition,
44
-	    Concerns\RouteDependencyResolver;
43
+    use Concerns\RouteCondition,
44
+        Concerns\RouteDependencyResolver;
45 45
 	
46
-	/**
47
-	 * Action that the route will use when called.
48
-	 *
49
-	 * @var \Closure|string|array $action
50
-	 */
51
-	public $action;
52
-
53
-	/**
54
-	 * The computed gathered middleware.
55
-	 * 
56
-	 * @var array|null $computedMiddleware
57
-	 */
58
-	public $computedMiddleware;
59
-
60
-	/**
61
-	 * The container instance used by the route.
62
-	 * 
63
-	 * @var \Syscodes\Container\Container $container
64
-	 */
65
-	protected $container;
66
-
67
-	/**
68
-	 * The controller instance.
69
-	 * 
70
-	 * @var string $controller
71
-	 */
72
-	public $controller;
73
-
74
-	/**
75
-	 * The default values for the route.
76
-	 * 
77
-	 * @var array $defaults
78
-	 */
79
-	public $defaults = [];
80
-
81
-	/**
82
-	 * Variable of HTTP method.
83
-	 *  
84
-	 * @var array|string $method
85
-	 */
86
-	public $method;
87
-
88
-	/**
89
-	 * The array of matched parameters.
90
-	 * 
91
-	 * @var array $parameters
92
-	 */
93
-	public $parameters = [];
94
-
95
-	/**
96
-	 * The parameter names for the route.
97
-	 * 
98
-	 * @var string|null $parameterNames
99
-	 */
100
-	public $parameterNames;
101
-
102
-	/**
103
-	* Patterns that should be replaced.
104
-	*
105
-	* @var array $patterns 
106
-	*/
107
-	public $patterns = [
108
-		'~/~'                    =>  '\/',               // Slash
109
-		'~{an:[^\/{}]+}~'        => '([0-9a-zA-Z]++)',   // Placeholder accepts alphabetic and numeric chars
110
-		'~{n:[^\/{}]+}~'         => '([0-9]++)',         // Placeholder accepts only numeric
111
-		'~{a:[^\/{}]+}~'         => '([a-zA-Z]++)',      // Placeholder accepts only alphabetic chars
112
-		'~{w:[^\/{}]+}~'         => '([0-9a-zA-Z-_]++)', // Placeholder accepts alphanumeric and underscore
113
-		'~{\*:[^\/{}]+}~'        => '(.++)',             // Placeholder match rest of url
114
-		'~(\\\/)?{\?:[^\/{}]+}~' => '\/?([^\/]*)',		 // Optional placeholder
115
-		'~{[^\/{}]+}~'           => '([^\/]++)'			 // Normal placeholder
116
-	];
117
-
118
-	/**
119
-	 * The URI pattern the route responds to.
120
-	 *
121
-	 * @var array $uri
122
-	 */
123
-	public $uri = [];
124
-
125
-	/**
126
-	 * Contains the arguments of the current route.
127
-	 *
128
-	 * @var array $where
129
-	 */
130
-	public $wheres = [];
131
-
132
-	/**
133
-	 * Constructor. Initialize route.
134
-	 *
135
-	 * @param  array|string|null  $method  
136
-	 * @param  string|null  $uri  
137
-	 * @param  \Closure|string|null  $action  
138
-	 *
139
-	 * @return void
140
-	 */
141
-	public function __construct($method = null, $uri = null, $action = null)
142
-	{
143
-		$this->uri = $uri;
144
-
145
-		// Set the method
146
-		$this->parseMethod($method);
147
-
148
-		// Set the action
149
-		$this->action = Arr::except($this->parseAction($action), ['prefix']);
150
-
151
-		if (is_null($prefix = Arr::get($this->action, 'prefix'))) {
152
-			$this->prefix($prefix);
153
-		}
154
-	}
155
-
156
-	// Getters
157
-
158
-	/**
159
-	 * Get the action of the current route.
160
-	 *
161
-	 * @return \Closure|string|array
162
-	 */
163
-	public function getAction()
164
-	{
165
-		return $this->action;
166
-	}
167
-
168
-	/**
169
-	 * Get the arguments of the current route.
170
-	 *
171
-	 * @return array
172
-	 */
173
-	public function getArguments()
174
-	{
175
-		return $this->wheres;
176
-	}
177
-
178
-	/**
179
-	 * Get the controller instance for the route.
180
-	 * 
181
-	 * @return mixed
182
-	 */
183
-	public function getController()
184
-	{
185
-		if ( ! $this->controller) {
186
-			$class = $this->parseControllerCallback()[0];
46
+    /**
47
+     * Action that the route will use when called.
48
+     *
49
+     * @var \Closure|string|array $action
50
+     */
51
+    public $action;
52
+
53
+    /**
54
+     * The computed gathered middleware.
55
+     * 
56
+     * @var array|null $computedMiddleware
57
+     */
58
+    public $computedMiddleware;
59
+
60
+    /**
61
+     * The container instance used by the route.
62
+     * 
63
+     * @var \Syscodes\Container\Container $container
64
+     */
65
+    protected $container;
66
+
67
+    /**
68
+     * The controller instance.
69
+     * 
70
+     * @var string $controller
71
+     */
72
+    public $controller;
73
+
74
+    /**
75
+     * The default values for the route.
76
+     * 
77
+     * @var array $defaults
78
+     */
79
+    public $defaults = [];
80
+
81
+    /**
82
+     * Variable of HTTP method.
83
+     *  
84
+     * @var array|string $method
85
+     */
86
+    public $method;
87
+
88
+    /**
89
+     * The array of matched parameters.
90
+     * 
91
+     * @var array $parameters
92
+     */
93
+    public $parameters = [];
94
+
95
+    /**
96
+     * The parameter names for the route.
97
+     * 
98
+     * @var string|null $parameterNames
99
+     */
100
+    public $parameterNames;
101
+
102
+    /**
103
+     * Patterns that should be replaced.
104
+     *
105
+     * @var array $patterns 
106
+     */
107
+    public $patterns = [
108
+        '~/~'                    =>  '\/',               // Slash
109
+        '~{an:[^\/{}]+}~'        => '([0-9a-zA-Z]++)',   // Placeholder accepts alphabetic and numeric chars
110
+        '~{n:[^\/{}]+}~'         => '([0-9]++)',         // Placeholder accepts only numeric
111
+        '~{a:[^\/{}]+}~'         => '([a-zA-Z]++)',      // Placeholder accepts only alphabetic chars
112
+        '~{w:[^\/{}]+}~'         => '([0-9a-zA-Z-_]++)', // Placeholder accepts alphanumeric and underscore
113
+        '~{\*:[^\/{}]+}~'        => '(.++)',             // Placeholder match rest of url
114
+        '~(\\\/)?{\?:[^\/{}]+}~' => '\/?([^\/]*)',		 // Optional placeholder
115
+        '~{[^\/{}]+}~'           => '([^\/]++)'			 // Normal placeholder
116
+    ];
117
+
118
+    /**
119
+     * The URI pattern the route responds to.
120
+     *
121
+     * @var array $uri
122
+     */
123
+    public $uri = [];
124
+
125
+    /**
126
+     * Contains the arguments of the current route.
127
+     *
128
+     * @var array $where
129
+     */
130
+    public $wheres = [];
131
+
132
+    /**
133
+     * Constructor. Initialize route.
134
+     *
135
+     * @param  array|string|null  $method  
136
+     * @param  string|null  $uri  
137
+     * @param  \Closure|string|null  $action  
138
+     *
139
+     * @return void
140
+     */
141
+    public function __construct($method = null, $uri = null, $action = null)
142
+    {
143
+        $this->uri = $uri;
144
+
145
+        // Set the method
146
+        $this->parseMethod($method);
147
+
148
+        // Set the action
149
+        $this->action = Arr::except($this->parseAction($action), ['prefix']);
150
+
151
+        if (is_null($prefix = Arr::get($this->action, 'prefix'))) {
152
+            $this->prefix($prefix);
153
+        }
154
+    }
155
+
156
+    // Getters
157
+
158
+    /**
159
+     * Get the action of the current route.
160
+     *
161
+     * @return \Closure|string|array
162
+     */
163
+    public function getAction()
164
+    {
165
+        return $this->action;
166
+    }
167
+
168
+    /**
169
+     * Get the arguments of the current route.
170
+     *
171
+     * @return array
172
+     */
173
+    public function getArguments()
174
+    {
175
+        return $this->wheres;
176
+    }
177
+
178
+    /**
179
+     * Get the controller instance for the route.
180
+     * 
181
+     * @return mixed
182
+     */
183
+    public function getController()
184
+    {
185
+        if ( ! $this->controller) {
186
+            $class = $this->parseControllerCallback()[0];
187 187
  
188
-			$this->controller = $this->container->make(ltrim($class, '\\'));
189
-		}
190
-
191
-		return $this->controller;
192
-	}
193
-
194
-	/**
195
-	 * Get the controller method used for the route.
196
-	 * 
197
-	 * @return string
198
-	 */
199
-	public function getControllerMethod()
200
-	{
201
-		return $this->parseControllerCallback()[1];
202
-	}
203
-
204
-	/**
205
-	 * Get the request method of the current route.
206
-	 *
207
-	 * @return array|string
208
-	 */
209
-	public function getMethod()
210
-	{
211
-		return $this->method;
212
-	}
213
-
214
-	/**
215
-	 * Get the url of the current route.
216
-	 *
217
-	 * @return string
218
-	 */
219
-	public function getName()
220
-	{
221
-		return $this->action['as'] ?? null;
222
-	}
223
-
224
-	/**
225
-	 * Get the url of the current route.
226
-	 *
227
-	 * @return array
228
-	 */
229
-	public function getRoute()
230
-	{
231
-		return $this->uri;
232
-	}
233
-
234
-	/**
235
-	 * Get or set the domain for the route.
236
-	 * 
237
-	 * @param  string|null  $domain  
238
-	 * 
239
-	 * @return $this
240
-	 */
241
-	public function domain($domain = null)
242
-	{
243
-		if (is_null($domain)) {
244
-			return $this->getDomain();
245
-		}
246
-
247
-		$this->action['domain'] = $this->parseRoute($domain);
248
-
249
-		return $this;
250
-	}
251
-
252
-	/**
253
-	 * Get the domain defined for the route.
254
-	 * 
255
-	 * @return string|null
256
-	 */
257
-	public function getDomain()
258
-	{
259
-		return isset($this->action['domain'])
260
-				? str_replace(['http://', 'https://'], '', $this->action['domain'])
261
-				: null;
262
-	}
263
-
264
-	/**
265
-	 * Parse the controller.
266
-	 * 
267
-	 * @return array
268
-	 */
269
-	public function parseControllerCallback()
270
-	{
271
-		return Str::parseCallback($this->action['uses']);
272
-	}
188
+            $this->controller = $this->container->make(ltrim($class, '\\'));
189
+        }
190
+
191
+        return $this->controller;
192
+    }
193
+
194
+    /**
195
+     * Get the controller method used for the route.
196
+     * 
197
+     * @return string
198
+     */
199
+    public function getControllerMethod()
200
+    {
201
+        return $this->parseControllerCallback()[1];
202
+    }
203
+
204
+    /**
205
+     * Get the request method of the current route.
206
+     *
207
+     * @return array|string
208
+     */
209
+    public function getMethod()
210
+    {
211
+        return $this->method;
212
+    }
213
+
214
+    /**
215
+     * Get the url of the current route.
216
+     *
217
+     * @return string
218
+     */
219
+    public function getName()
220
+    {
221
+        return $this->action['as'] ?? null;
222
+    }
223
+
224
+    /**
225
+     * Get the url of the current route.
226
+     *
227
+     * @return array
228
+     */
229
+    public function getRoute()
230
+    {
231
+        return $this->uri;
232
+    }
233
+
234
+    /**
235
+     * Get or set the domain for the route.
236
+     * 
237
+     * @param  string|null  $domain  
238
+     * 
239
+     * @return $this
240
+     */
241
+    public function domain($domain = null)
242
+    {
243
+        if (is_null($domain)) {
244
+            return $this->getDomain();
245
+        }
246
+
247
+        $this->action['domain'] = $this->parseRoute($domain);
248
+
249
+        return $this;
250
+    }
251
+
252
+    /**
253
+     * Get the domain defined for the route.
254
+     * 
255
+     * @return string|null
256
+     */
257
+    public function getDomain()
258
+    {
259
+        return isset($this->action['domain'])
260
+                ? str_replace(['http://', 'https://'], '', $this->action['domain'])
261
+                : null;
262
+    }
263
+
264
+    /**
265
+     * Parse the controller.
266
+     * 
267
+     * @return array
268
+     */
269
+    public function parseControllerCallback()
270
+    {
271
+        return Str::parseCallback($this->action['uses']);
272
+    }
273 273
 	
274
-	/**
275
-	 * Checks whether the route's action is a controller.
276
-	 * 
277
-	 * @return bool
278
-	 */
279
-	public function isControllerAction()
280
-	{
281
-		return is_string($this->action['uses']);
282
-	}
283
-
284
-	/**
285
-	 * Get the dispatcher for the route's controller.
286
-	 * 
287
-	 * @return \Syscodes\Controller\ControllerDispatcher
288
-	 */
289
-	private function controllerDispatcher()
290
-	{
291
-		return new ControllerDispatcher($this->container);
292
-	}
293
-
294
-	// Setters
274
+    /**
275
+     * Checks whether the route's action is a controller.
276
+     * 
277
+     * @return bool
278
+     */
279
+    public function isControllerAction()
280
+    {
281
+        return is_string($this->action['uses']);
282
+    }
283
+
284
+    /**
285
+     * Get the dispatcher for the route's controller.
286
+     * 
287
+     * @return \Syscodes\Controller\ControllerDispatcher
288
+     */
289
+    private function controllerDispatcher()
290
+    {
291
+        return new ControllerDispatcher($this->container);
292
+    }
293
+
294
+    // Setters
295 295
 	
296
-	/**
297
-	 * Run the route action and return the response.
298
-	 * 
299
-	 * @return mixed
300
-	 */
301
-	public function runResolver()
302
-	{
303
-		$this->container = $this->container ?: new Container;
304
-
305
-		try {
306
-			if ($this->isControllerAction()) {
307
-				return $this->runResolverController();
308
-			}
309
-
310
-			return $this->runResolverCallable();
311
-		} catch (HttpResponseException $e) {
312
-			return $e->getResponse();
313
-		}
314
-	}
315
-
316
-	/**
317
-	 * Run the route action and return the response.
318
-	 *  
319
-	 * @return mixed
320
-	 */
321
-	protected function runResolverCallable()
322
-	{
323
-		$callable = $this->action['uses'];
324
-
325
-		return $callable(...array_values($this->resolveMethodDependencies(
326
-			$this->parametersWithouNulls(), new ReflectionFunction($this->action['uses'])
327
-		)));
328
-	}
329
-
330
-	/**
331
-	 * Run the route action and return the response.
332
-	 * 
333
-	 * @return mixed
334
-	 */
335
-	protected function runResolverController()
336
-	{
337
-		return $this->controllerDispatcher()->dispatch($this, $this->getController(), $this->getControllerMethod());
338
-	}
339
-
340
-	/**
341
-	 * Set the action.
342
-	 *
343
-	 * @param  \Closure|string  $action
344
-	 *
345
-	 * @return $this
346
-	 *
347
-	 * @throws \InvalidArgumentException
348
-	 */
349
-	public function parseAction($action)
350
-	{
351
-		if ( ! (is_object($action) && ($action instanceof Closure)) && ($action === null || $action === '')) {
352
-			throw new InvalidArgumentException(__('route.actionClosureOrFunction'));
353
-		}
354
-
355
-		return RouteAction::parse($this->uri, $action);
356
-	}
357
-
358
-	/**
359
-	 * Set the method of the current route.
360
-	 *
361
-	 * @param  array  $method
362
-	 *
363
-	 * @return string $this
364
-	 * 
365
-	 * @throws \InvalidArgumentException
366
-	 */
367
-	public function parseMethod($method)
368
-	{
369
-		if ($method === null || empty($method)) {
370
-			throw new InvalidArgumentException(__('route.methodNotProvided'));			
371
-		}
372
-
373
-		foreach ((array) $method as $httpMethod) {
374
-			if ( ! in_array($httpMethod, ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS', 'HEAD', 'ANY'])) {
375
-				throw new InvalidArgumentException(__('route.methodNotAllowed'));				
376
-			}
377
-		}
378
-
379
-	    $this->method = $method;
380
-
381
-	    return $this;
382
-	}
383
-
384
-	/**
385
-	 * Set the route.
386
-	 *
387
-	 * @param  string|array|null  $uri
388
-	 *
389
-	 * @return string
390
-	 *
391
-	 * @throws  \InvalidArgumentException
392
-	 */
393
-	public function parseRoute($uri)
394
-	{
395
-		if ($uri === null) {
396
-			throw new InvalidArgumentException(__('route.uriNotProvided'));
397
-		}	
398
-
399
-		$this->uri = $this->parseRoutePath($uri);
400
-
401
-		return $this;
402
-	}
403
-
404
-	/**
405
-	 * Replace word patterns with regex in route uri.
406
-	 * 
407
-	 * @param  string  $uri
408
-	 * 
409
-	 * @return string
410
-	 */
411
-	protected function parseRoutePath($uri)
412
-	{
413
-		$uri = trim($uri, '\/?');
414
-		$uri = trim($uri, '\/');
296
+    /**
297
+     * Run the route action and return the response.
298
+     * 
299
+     * @return mixed
300
+     */
301
+    public function runResolver()
302
+    {
303
+        $this->container = $this->container ?: new Container;
304
+
305
+        try {
306
+            if ($this->isControllerAction()) {
307
+                return $this->runResolverController();
308
+            }
309
+
310
+            return $this->runResolverCallable();
311
+        } catch (HttpResponseException $e) {
312
+            return $e->getResponse();
313
+        }
314
+    }
315
+
316
+    /**
317
+     * Run the route action and return the response.
318
+     *  
319
+     * @return mixed
320
+     */
321
+    protected function runResolverCallable()
322
+    {
323
+        $callable = $this->action['uses'];
324
+
325
+        return $callable(...array_values($this->resolveMethodDependencies(
326
+            $this->parametersWithouNulls(), new ReflectionFunction($this->action['uses'])
327
+        )));
328
+    }
329
+
330
+    /**
331
+     * Run the route action and return the response.
332
+     * 
333
+     * @return mixed
334
+     */
335
+    protected function runResolverController()
336
+    {
337
+        return $this->controllerDispatcher()->dispatch($this, $this->getController(), $this->getControllerMethod());
338
+    }
339
+
340
+    /**
341
+     * Set the action.
342
+     *
343
+     * @param  \Closure|string  $action
344
+     *
345
+     * @return $this
346
+     *
347
+     * @throws \InvalidArgumentException
348
+     */
349
+    public function parseAction($action)
350
+    {
351
+        if ( ! (is_object($action) && ($action instanceof Closure)) && ($action === null || $action === '')) {
352
+            throw new InvalidArgumentException(__('route.actionClosureOrFunction'));
353
+        }
354
+
355
+        return RouteAction::parse($this->uri, $action);
356
+    }
357
+
358
+    /**
359
+     * Set the method of the current route.
360
+     *
361
+     * @param  array  $method
362
+     *
363
+     * @return string $this
364
+     * 
365
+     * @throws \InvalidArgumentException
366
+     */
367
+    public function parseMethod($method)
368
+    {
369
+        if ($method === null || empty($method)) {
370
+            throw new InvalidArgumentException(__('route.methodNotProvided'));			
371
+        }
372
+
373
+        foreach ((array) $method as $httpMethod) {
374
+            if ( ! in_array($httpMethod, ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS', 'HEAD', 'ANY'])) {
375
+                throw new InvalidArgumentException(__('route.methodNotAllowed'));				
376
+            }
377
+        }
378
+
379
+        $this->method = $method;
380
+
381
+        return $this;
382
+    }
383
+
384
+    /**
385
+     * Set the route.
386
+     *
387
+     * @param  string|array|null  $uri
388
+     *
389
+     * @return string
390
+     *
391
+     * @throws  \InvalidArgumentException
392
+     */
393
+    public function parseRoute($uri)
394
+    {
395
+        if ($uri === null) {
396
+            throw new InvalidArgumentException(__('route.uriNotProvided'));
397
+        }	
398
+
399
+        $this->uri = $this->parseRoutePath($uri);
400
+
401
+        return $this;
402
+    }
403
+
404
+    /**
405
+     * Replace word patterns with regex in route uri.
406
+     * 
407
+     * @param  string  $uri
408
+     * 
409
+     * @return string
410
+     */
411
+    protected function parseRoutePath($uri)
412
+    {
413
+        $uri = trim($uri, '\/?');
414
+        $uri = trim($uri, '\/');
415 415
 		
416
-		preg_match_all('/\{([\w\:]+?)\??\}/', $uri, $matches);
416
+        preg_match_all('/\{([\w\:]+?)\??\}/', $uri, $matches);
417 417
 		
418
-		foreach ($matches[1] as $match) {
419
-			if (strpos($match, ':') === false) {
420
-				continue;
421
-			}
418
+        foreach ($matches[1] as $match) {
419
+            if (strpos($match, ':') === false) {
420
+                continue;
421
+            }
422 422
 			
423
-			$pattern  = array_keys($this->patterns);
424
-			$replace  = array_values($this->patterns);
425
-			$segments = explode(':', trim($match, '{}?'));
423
+            $pattern  = array_keys($this->patterns);
424
+            $replace  = array_values($this->patterns);
425
+            $segments = explode(':', trim($match, '{}?'));
426 426
 			
427
-			$uri = strpos($match, ':') !== false
428
-					? preg_replace($pattern, $replace, $uri)
429
-					: str_replace($match, '{'.$segments[0].'}', $uri);
430
-		}
427
+            $uri = strpos($match, ':') !== false
428
+                    ? preg_replace($pattern, $replace, $uri)
429
+                    : str_replace($match, '{'.$segments[0].'}', $uri);
430
+        }
431 431
 		
432
-		return $uri;
433
-	}
434
-
435
-	/**
436
-	 * Add a prefix to the route URI.
437
-	 * 
438
-	 * @param  string  $prefix
439
-	 * 
440
-	 * @return $this
441
-	 */
442
-	public function prefix($prefix)
443
-	{
444
-		if ( ! empty($newPrefix = trim(rtrim($prefix, '/').'/'.ltrim($this->action['prefix'] ?? '', '/'), '/'))) {
445
-			$this->action['prefix'] = $newPrefix;
446
-		}
432
+        return $uri;
433
+    }
434
+
435
+    /**
436
+     * Add a prefix to the route URI.
437
+     * 
438
+     * @param  string  $prefix
439
+     * 
440
+     * @return $this
441
+     */
442
+    public function prefix($prefix)
443
+    {
444
+        if ( ! empty($newPrefix = trim(rtrim($prefix, '/').'/'.ltrim($this->action['prefix'] ?? '', '/'), '/'))) {
445
+            $this->action['prefix'] = $newPrefix;
446
+        }
447 447
 		
448
-		$uri = rtrim($prefix, '/').'/'.ltrim($this->uri, '/');
448
+        $uri = rtrim($prefix, '/').'/'.ltrim($this->uri, '/');
449 449
 		
450
-		return $this->parseRoute($uri !== '/' ? trim($uri, '/') : $uri);
451
-	}
452
-
453
-	/**
454
-	 * Set the action array for the route.
455
-	 * 
456
-	 * @param  array  $action
457
-	 * 
458
-	 * @return $this
459
-	 */
460
-	public function setAction(array $action)
461
-	{
462
-		$this->action = $action;
463
-
464
-		if (isset($this->action['domain'])) {
465
-			$this->domain($this->action['domain']);
466
-		}
450
+        return $this->parseRoute($uri !== '/' ? trim($uri, '/') : $uri);
451
+    }
452
+
453
+    /**
454
+     * Set the action array for the route.
455
+     * 
456
+     * @param  array  $action
457
+     * 
458
+     * @return $this
459
+     */
460
+    public function setAction(array $action)
461
+    {
462
+        $this->action = $action;
463
+
464
+        if (isset($this->action['domain'])) {
465
+            $this->domain($this->action['domain']);
466
+        }
467 467
 		
468
-		return $this;
469
-	}
470
-
471
-	/**
472
-	 * Set the name.
473
-	 *
474
-	 * @param  string  $name
475
-	 *
476
-	 * @return $this
477
-	 */
478
-	public function name($name)
479
-	{
480
-		$this->action['as'] = isset($this->action['as']) ? $this->action['as'].$name : $name;
481
-
482
-		return $this;
483
-	}
484
-
485
-	/**
486
-	 * Determine whether the route's name matches the given patterns.
487
-	 * 
488
-	 * @param  mixed  ...$patterns
489
-	 * 
490
-	 * @return bool
491
-	 */
492
-	public function named(...$patterns)
493
-	{
494
-		if (is_null($routeName = $this->getName())) {
495
-			return false;
496
-		}
497
-
498
-		foreach ($patterns as $pattern) {
499
-			if (Str::is($pattern, $routeName)) {
500
-				return true;
501
-			}
502
-		}
503
-
504
-		return false;
505
-	}
506
-
507
-	/**
508
-	 * Set a default value for the route.
509
-	 * 
510
-	 * @param  string  $key
511
-	 * @param  mixed   $value
512
-	 * 
513
-	 * @return $this
514
-	 */
515
-	public function defaults($key, $value)
516
-	{
517
-		$this->defaults[$key] = $value;
518
-
519
-		return $this;
520
-	}
521
-
522
-	/**
523
-	 * Set a default values for the route.
524
-	 * 
525
-	 * @param  string  $defaults
526
-	 * 
527
-	 * @return $this
528
-	 */
529
-	public function setDefaults(array $defaults)
530
-	{
531
-		$this->defaults = $defaults;
532
-
533
-		return $this;
534
-	}
535
-
536
-	/**
537
-	 * Set the where.
538
-	 *
539
-	 * @param  array|string  $name
540
-	 * @param  string|null  $expression  
541
-	 *
542
-	 * @return $this
543
-	 */
544
-	public function where($name, string $expression = null)
545
-	{
546
-		$wheres = is_array($name) ? $name : [$name => $expression];
468
+        return $this;
469
+    }
470
+
471
+    /**
472
+     * Set the name.
473
+     *
474
+     * @param  string  $name
475
+     *
476
+     * @return $this
477
+     */
478
+    public function name($name)
479
+    {
480
+        $this->action['as'] = isset($this->action['as']) ? $this->action['as'].$name : $name;
481
+
482
+        return $this;
483
+    }
484
+
485
+    /**
486
+     * Determine whether the route's name matches the given patterns.
487
+     * 
488
+     * @param  mixed  ...$patterns
489
+     * 
490
+     * @return bool
491
+     */
492
+    public function named(...$patterns)
493
+    {
494
+        if (is_null($routeName = $this->getName())) {
495
+            return false;
496
+        }
497
+
498
+        foreach ($patterns as $pattern) {
499
+            if (Str::is($pattern, $routeName)) {
500
+                return true;
501
+            }
502
+        }
503
+
504
+        return false;
505
+    }
506
+
507
+    /**
508
+     * Set a default value for the route.
509
+     * 
510
+     * @param  string  $key
511
+     * @param  mixed   $value
512
+     * 
513
+     * @return $this
514
+     */
515
+    public function defaults($key, $value)
516
+    {
517
+        $this->defaults[$key] = $value;
518
+
519
+        return $this;
520
+    }
521
+
522
+    /**
523
+     * Set a default values for the route.
524
+     * 
525
+     * @param  string  $defaults
526
+     * 
527
+     * @return $this
528
+     */
529
+    public function setDefaults(array $defaults)
530
+    {
531
+        $this->defaults = $defaults;
532
+
533
+        return $this;
534
+    }
535
+
536
+    /**
537
+     * Set the where.
538
+     *
539
+     * @param  array|string  $name
540
+     * @param  string|null  $expression  
541
+     *
542
+     * @return $this
543
+     */
544
+    public function where($name, string $expression = null)
545
+    {
546
+        $wheres = is_array($name) ? $name : [$name => $expression];
547 547
 		
548
-		foreach ($wheres as $name => $expression) {
549
-			$this->wheres[$name] = $expression;
550
-		}
551
-
552
-		return $this;
553
-	}
554
-
555
-	/**
556
-	 * Bind the route to a given request for execution.
557
-	 * 
558
-	 * @param  \Syscodes\Http\Request  $request
559
-	 * 
560
-	 * @return $this
561
-	 */
562
-	public function bind(Request $request)
563
-	{
564
-		$this->parameters = (new RouteParamBinding($this))->parameters($request);
565
-
566
-		return $this;
567
-	}
568
-
569
-	/**
570
-	 * Get all of the parameter names for the route.
571
-	 * 
572
-	 * @return array
573
-	 */
574
-	public function parameterNames()
575
-	{
576
-		if (isset($this->parameterNames)) {
577
-			return $this->parameterNames;
578
-		}
579
-
580
-		return $this->parameterNames = $this->compileParamNames();
581
-	}
582
-
583
-	/**
584
-	 * Get the parameter names for the route.
585
-	 * 
586
-	 * @return array
587
-	 */
588
-	protected function compileParamNames()
589
-	{
590
-		preg_match_all('~[^\/\{(.*?)\}]~', $this->domain().$this->uri, $matches);
591
-
592
-		return array_map(function ($match) {
593
-			return trim($match, '?');
594
-		}, $matches[0]);
595
-	}
596
-
597
-	/**
598
-	 * Get a given parameter from the route.
599
-	 * 
600
-	 * @param  string  $name
601
-	 * @param  mixed  $default  
602
-	 * 
603
-	 * @return array
604
-	 */
605
-	public function parameter($name, $default = null)
606
-	{
607
-		return Arr::get($this->parameters(), $name, $default);
608
-	}
609
-
610
-	/**
611
-	 * Set a parameter to the given value.
612
-	 * 
613
-	 * @param  string  $name
614
-	 * @param  mixed  $value
615
-	 * 
616
-	 * @return array
617
-	 */
618
-	public function setParameter($name, $value)
619
-	{
620
-		$this->parameters();
621
-
622
-		$this->parameters[$name] = $value;
623
-	}
624
-
625
-	/**
626
-	 * Get the key / value list of parameters without null values.
627
-	 * 
628
-	 * @return array
629
-	 */
630
-	public function parametersWithouNulls()
631
-	{
632
-		return array_filter($this->parameters(), function ($parameter) {
633
-			return ! is_null($parameter);
634
-		});
635
-	}
636
-
637
-	/**
638
-	 * Get the key / value list of parameters for the route.
639
-	 * 
640
-	 * @return array
641
-	 */
642
-	public function parameters()
643
-	{
644
-		if (isset($this->parameters)) {
645
-			return $this->parameters;
646
-		}
647
-
648
-		throw new LogicException('The route is not bound.');
649
-	}
650
-
651
-	/**
652
-	 * Get all middleware, including the ones from the controller.
653
-	 * 
654
-	 * @return array
655
-	 */
656
-	public function gatherMiddleware()
657
-	{
658
-		if ( ! is_null($this->computedMiddleware)) {
659
-			return $this->computedMiddleware;
660
-		}
661
-
662
-		$this->computedMiddleware = [];
663
-
664
-		return $this->computedMiddleware = array_unique(array_merge(
665
-			$this->middleware(),
666
-			$this->controllerMiddleware()
667
-		), SORT_REGULAR);
668
-	}
669
-
670
-	/**
671
-	 * Get or set the middlewares attached to the route.
672
-	 * 
673
-	 * @param  array|string|null  $middleware
674
-	 * 
675
-	 * @return $this|array
676
-	 */
677
-	public function middleware($middleware = null)
678
-	{
679
-		if (is_null($middleware)) {
680
-			return $this->getMiddleware();
681
-		}
682
-
683
-		if (is_string($middleware)) {
684
-			$middleware = func_get_args();
685
-		}
686
-
687
-		$this->action['middleware'] = array_merge(
688
-			$this->getMiddleware(),
689
-			$middleware
690
-		);
691
-
692
-		return $this;
693
-	}
694
-
695
-	/**
696
-	 * Get the middlewares attached to the route.
697
-	 * 
698
-	 * @return array
699
-	 */
700
-	protected function getMiddleware()
701
-	{
702
-		return (array) ($this->action['middleware'] ?? []);
703
-	}
704
-
705
-	/**
706
-	 * Get the middleware for the route's controller.
707
-	 * 
708
-	 * @return array
709
-	 */
710
-	public function controllerMiddleware()
711
-	{
712
-		if ( ! $this->isControllerAction()) {
713
-			return [];
714
-		}
715
-
716
-		return $this->controllerDispatcher()->getMiddleware(
717
-			$this->getController(),
718
-			$this->getControllerMethod()
719
-		);
720
-	}
721
-
722
-	/**
723
-	 * Determine if the route only responds to HTTP requests.
724
-	 * 
725
-	 * @return bool
726
-	 */
727
-	public function httpOnly()
728
-	{
729
-		return in_array('http', $this->action, true);
730
-	}
731
-
732
-	/**
733
-	 * Determine if the route only responds to HTTPS requests.
734
-	 * 
735
-	 * @return bool
736
-	 */
737
-	public function httpsOnly()
738
-	{
739
-		return $this->secure();
740
-	}
741
-
742
-	/**
743
-	 * Determine if the route only responds to HTTPS requests.
744
-	 * 
745
-	 * @return bool
746
-	 */
747
-	public function secure()
748
-	{
749
-		return in_array('https', $this->action, true);
750
-	}
751
-
752
-	/**
753
-	 * Set the container instance on the route.
754
-	 * 
755
-	 * @param  \Syscodes\Container\Container  $container
756
-	 * 
757
-	 * @return $this
758
-	 */
759
-	public function setContainer(Container $container)
760
-	{
761
-		$this->container = $container;
762
-
763
-		return $this;
764
-	}
765
-
766
-	/**
767
-	 * Dynamically access route parameters.
768
-	 * 
769
-	 * @param  string  $key
770
-	 * 
771
-	 * @return mixed
772
-	 */
773
-	public function __get($key)
774
-	{
775
-		return $this->parameter($key);
776
-	}
548
+        foreach ($wheres as $name => $expression) {
549
+            $this->wheres[$name] = $expression;
550
+        }
551
+
552
+        return $this;
553
+    }
554
+
555
+    /**
556
+     * Bind the route to a given request for execution.
557
+     * 
558
+     * @param  \Syscodes\Http\Request  $request
559
+     * 
560
+     * @return $this
561
+     */
562
+    public function bind(Request $request)
563
+    {
564
+        $this->parameters = (new RouteParamBinding($this))->parameters($request);
565
+
566
+        return $this;
567
+    }
568
+
569
+    /**
570
+     * Get all of the parameter names for the route.
571
+     * 
572
+     * @return array
573
+     */
574
+    public function parameterNames()
575
+    {
576
+        if (isset($this->parameterNames)) {
577
+            return $this->parameterNames;
578
+        }
579
+
580
+        return $this->parameterNames = $this->compileParamNames();
581
+    }
582
+
583
+    /**
584
+     * Get the parameter names for the route.
585
+     * 
586
+     * @return array
587
+     */
588
+    protected function compileParamNames()
589
+    {
590
+        preg_match_all('~[^\/\{(.*?)\}]~', $this->domain().$this->uri, $matches);
591
+
592
+        return array_map(function ($match) {
593
+            return trim($match, '?');
594
+        }, $matches[0]);
595
+    }
596
+
597
+    /**
598
+     * Get a given parameter from the route.
599
+     * 
600
+     * @param  string  $name
601
+     * @param  mixed  $default  
602
+     * 
603
+     * @return array
604
+     */
605
+    public function parameter($name, $default = null)
606
+    {
607
+        return Arr::get($this->parameters(), $name, $default);
608
+    }
609
+
610
+    /**
611
+     * Set a parameter to the given value.
612
+     * 
613
+     * @param  string  $name
614
+     * @param  mixed  $value
615
+     * 
616
+     * @return array
617
+     */
618
+    public function setParameter($name, $value)
619
+    {
620
+        $this->parameters();
621
+
622
+        $this->parameters[$name] = $value;
623
+    }
624
+
625
+    /**
626
+     * Get the key / value list of parameters without null values.
627
+     * 
628
+     * @return array
629
+     */
630
+    public function parametersWithouNulls()
631
+    {
632
+        return array_filter($this->parameters(), function ($parameter) {
633
+            return ! is_null($parameter);
634
+        });
635
+    }
636
+
637
+    /**
638
+     * Get the key / value list of parameters for the route.
639
+     * 
640
+     * @return array
641
+     */
642
+    public function parameters()
643
+    {
644
+        if (isset($this->parameters)) {
645
+            return $this->parameters;
646
+        }
647
+
648
+        throw new LogicException('The route is not bound.');
649
+    }
650
+
651
+    /**
652
+     * Get all middleware, including the ones from the controller.
653
+     * 
654
+     * @return array
655
+     */
656
+    public function gatherMiddleware()
657
+    {
658
+        if ( ! is_null($this->computedMiddleware)) {
659
+            return $this->computedMiddleware;
660
+        }
661
+
662
+        $this->computedMiddleware = [];
663
+
664
+        return $this->computedMiddleware = array_unique(array_merge(
665
+            $this->middleware(),
666
+            $this->controllerMiddleware()
667
+        ), SORT_REGULAR);
668
+    }
669
+
670
+    /**
671
+     * Get or set the middlewares attached to the route.
672
+     * 
673
+     * @param  array|string|null  $middleware
674
+     * 
675
+     * @return $this|array
676
+     */
677
+    public function middleware($middleware = null)
678
+    {
679
+        if (is_null($middleware)) {
680
+            return $this->getMiddleware();
681
+        }
682
+
683
+        if (is_string($middleware)) {
684
+            $middleware = func_get_args();
685
+        }
686
+
687
+        $this->action['middleware'] = array_merge(
688
+            $this->getMiddleware(),
689
+            $middleware
690
+        );
691
+
692
+        return $this;
693
+    }
694
+
695
+    /**
696
+     * Get the middlewares attached to the route.
697
+     * 
698
+     * @return array
699
+     */
700
+    protected function getMiddleware()
701
+    {
702
+        return (array) ($this->action['middleware'] ?? []);
703
+    }
704
+
705
+    /**
706
+     * Get the middleware for the route's controller.
707
+     * 
708
+     * @return array
709
+     */
710
+    public function controllerMiddleware()
711
+    {
712
+        if ( ! $this->isControllerAction()) {
713
+            return [];
714
+        }
715
+
716
+        return $this->controllerDispatcher()->getMiddleware(
717
+            $this->getController(),
718
+            $this->getControllerMethod()
719
+        );
720
+    }
721
+
722
+    /**
723
+     * Determine if the route only responds to HTTP requests.
724
+     * 
725
+     * @return bool
726
+     */
727
+    public function httpOnly()
728
+    {
729
+        return in_array('http', $this->action, true);
730
+    }
731
+
732
+    /**
733
+     * Determine if the route only responds to HTTPS requests.
734
+     * 
735
+     * @return bool
736
+     */
737
+    public function httpsOnly()
738
+    {
739
+        return $this->secure();
740
+    }
741
+
742
+    /**
743
+     * Determine if the route only responds to HTTPS requests.
744
+     * 
745
+     * @return bool
746
+     */
747
+    public function secure()
748
+    {
749
+        return in_array('https', $this->action, true);
750
+    }
751
+
752
+    /**
753
+     * Set the container instance on the route.
754
+     * 
755
+     * @param  \Syscodes\Container\Container  $container
756
+     * 
757
+     * @return $this
758
+     */
759
+    public function setContainer(Container $container)
760
+    {
761
+        $this->container = $container;
762
+
763
+        return $this;
764
+    }
765
+
766
+    /**
767
+     * Dynamically access route parameters.
768
+     * 
769
+     * @param  string  $key
770
+     * 
771
+     * @return mixed
772
+     */
773
+    public function __get($key)
774
+    {
775
+        return $this->parameter($key);
776
+    }
777 777
 }
778 778
\ No newline at end of file
Please login to merge, or discard this patch.
src/components/Routing/Concerns/RouteDependencyResolver.php 1 patch
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.
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 1 patch
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.
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/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.