@@ -61,11 +61,11 @@ |
||
| 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. |
@@ -290,7 +290,7 @@ |
||
| 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 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -56,8 +56,7 @@ |
||
| 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 | } |
@@ -97,7 +97,7 @@ |
||
| 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 | }); |
@@ -347,7 +347,7 @@ |
||
| 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)); |
@@ -173,8 +173,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -31,14 +31,14 @@ |
||
| 31 | 31 | interface Lenevor |
| 32 | 32 | { |
| 33 | 33 | /** |
| 34 | - * Initializes the framework, this can only be called once. |
|
| 35 | - * Launch the application. |
|
| 36 | - * |
|
| 37 | - * @param \Syscodes\http\Request $request |
|
| 38 | - * |
|
| 39 | - * @return void |
|
| 40 | - * |
|
| 41 | - * @uses new \Syscodes\Http\Response |
|
| 42 | - */ |
|
| 43 | - public function handle($request); |
|
| 34 | + * Initializes the framework, this can only be called once. |
|
| 35 | + * Launch the application. |
|
| 36 | + * |
|
| 37 | + * @param \Syscodes\http\Request $request |
|
| 38 | + * |
|
| 39 | + * @return void |
|
| 40 | + * |
|
| 41 | + * @uses new \Syscodes\Http\Response |
|
| 42 | + */ |
|
| 43 | + public function handle($request); |
|
| 44 | 44 | } |
| 45 | 45 | \ No newline at end of file |
@@ -31,94 +31,94 @@ |
||
| 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 |
@@ -30,19 +30,19 @@ |
||
| 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 |
@@ -31,12 +31,12 @@ |
||
| 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 | /** |
@@ -32,29 +32,29 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | interface View extends Renderable |
| 34 | 34 | { |
| 35 | - /** |
|
| 36 | - * Add a piece of data to the view. |
|
| 37 | - * |
|
| 38 | - * @example $view->assign($content, $data); |
|
| 39 | - * |
|
| 40 | - * @param string|array $key |
|
| 41 | - * @param mixed $value |
|
| 42 | - * |
|
| 43 | - * @return $this |
|
| 44 | - */ |
|
| 45 | - public function assign($key, $value = null); |
|
| 35 | + /** |
|
| 36 | + * Add a piece of data to the view. |
|
| 37 | + * |
|
| 38 | + * @example $view->assign($content, $data); |
|
| 39 | + * |
|
| 40 | + * @param string|array $key |
|
| 41 | + * @param mixed $value |
|
| 42 | + * |
|
| 43 | + * @return $this |
|
| 44 | + */ |
|
| 45 | + public function assign($key, $value = null); |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Assigns a value by reference. The benefit of binding is that values can be altered |
|
| 49 | - * without re-setting them. It is also possible to bind variables before they have values. |
|
| 50 | - * Assigned values will be available as a variable within the view file: |
|
| 51 | - * |
|
| 52 | - * @example $view->bind('ref', $bar); |
|
| 53 | - * |
|
| 54 | - * @param string $key Variable name |
|
| 55 | - * @param mixed $value Referenced variable |
|
| 56 | - * |
|
| 57 | - * @return $this |
|
| 58 | - */ |
|
| 59 | - public function bind($key, & $value); |
|
| 47 | + /** |
|
| 48 | + * Assigns a value by reference. The benefit of binding is that values can be altered |
|
| 49 | + * without re-setting them. It is also possible to bind variables before they have values. |
|
| 50 | + * Assigned values will be available as a variable within the view file: |
|
| 51 | + * |
|
| 52 | + * @example $view->bind('ref', $bar); |
|
| 53 | + * |
|
| 54 | + * @param string $key Variable name |
|
| 55 | + * @param mixed $value Referenced variable |
|
| 56 | + * |
|
| 57 | + * @return $this |
|
| 58 | + */ |
|
| 59 | + public function bind($key, & $value); |
|
| 60 | 60 | } |
| 61 | 61 | \ No newline at end of file |