@@ -31,9 +31,9 @@ |
||
31 | 31 | private function normalizeView(array $views): array |
32 | 32 | { |
33 | 33 | $views = $this->normalizeInput($views); |
34 | - $mapper = function ($view) { |
|
34 | + $mapper = function($view) { |
|
35 | 35 | $this->checkViewExists($view); |
36 | - return 'creating: '.\Illuminate\View\ViewName::normalize($view); |
|
36 | + return 'creating: ' . \Illuminate\View\ViewName::normalize($view); |
|
37 | 37 | }; |
38 | 38 | |
39 | 39 | return array_map($mapper, $views); |
@@ -73,7 +73,7 @@ |
||
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | - return function () { |
|
76 | + return function() { |
|
77 | 77 | }; |
78 | 78 | } |
79 | 79 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | */ |
14 | 14 | public function whenYouVisitUrl(...$url) |
15 | 15 | { |
16 | - $removeSlash = function ($url) { |
|
16 | + $removeSlash = function($url) { |
|
17 | 17 | return ltrim($url, '/'); |
18 | 18 | }; |
19 | 19 | |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function whenYouCallAction(...$action) |
41 | 41 | { |
42 | - $addNamespace = function ($action) { |
|
42 | + $addNamespace = function($action) { |
|
43 | 43 | if ($action = ltrim($action, '\\')) { |
44 | 44 | return $action; |
45 | 45 | } |
46 | 46 | |
47 | - return app()->getNamespace().'\\Http\\Controllers\\'.$action; |
|
47 | + return app()->getNamespace() . '\\Http\\Controllers\\' . $action; |
|
48 | 48 | }; |
49 | 49 | |
50 | 50 | $action = array_map($addNamespace, $this->normalizeInput($action)); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | { |
10 | 10 | public function authorizeMatchedRoutes() |
11 | 11 | { |
12 | - Route::matched(function (RouteMatched $eventObj) { |
|
12 | + Route::matched(function(RouteMatched $eventObj) { |
|
13 | 13 | $route = $eventObj->route; |
14 | 14 | if ($eventObj->request->method() === 'GET') { |
15 | 15 | $this->authorizeUrls($route->uri); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | private function setGuardFor($method, $key) |
57 | 57 | { |
58 | - $method = 'get'.$method; |
|
58 | + $method = 'get' . $method; |
|
59 | 59 | app(RouteConditionApplier::class)->{$method}($key)(); |
60 | 60 | } |
61 | 61 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | { |
61 | 61 | $this->chain->reset(); |
62 | 62 | |
63 | - $responder = function () use ($e) { |
|
63 | + $responder = function() use ($e) { |
|
64 | 64 | $exClass = $e['class']; |
65 | 65 | throw new $exClass($e['message']); |
66 | 66 | }; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $this->chain->reset(); |
80 | 80 | |
81 | - $responder = function () use ($resp) { |
|
81 | + $responder = function() use ($resp) { |
|
82 | 82 | $respObj = response(); |
83 | 83 | foreach ($resp as $call) { |
84 | 84 | list($method, $args) = $call; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | { |
95 | 95 | $this->chain->reset(); |
96 | 96 | |
97 | - $responder = function () use ($resp) { |
|
97 | + $responder = function() use ($resp) { |
|
98 | 98 | $respObj = redirect(); |
99 | 99 | foreach ($resp as $call) { |
100 | 100 | list($method, $args) = $call; |
@@ -117,9 +117,9 @@ discard block |
||
117 | 117 | $calls = $this->caller; |
118 | 118 | |
119 | 119 | |
120 | - $this->caller = $this->dispatcher = function () { |
|
120 | + $this->caller = $this->dispatcher = function() { |
|
121 | 121 | }; |
122 | - return function (...$f) use ($responder, $cb, $dispatcher, $calls) { |
|
122 | + return function(...$f) use ($responder, $cb, $dispatcher, $calls) { |
|
123 | 123 | if ($cb($f)) { |
124 | 124 | return true; |
125 | 125 | } |
@@ -134,12 +134,12 @@ discard block |
||
134 | 134 | { |
135 | 135 | $events = $this->chain->events; |
136 | 136 | |
137 | - if (! $events) { |
|
138 | - return $this->dispatcher = function () { |
|
137 | + if (!$events) { |
|
138 | + return $this->dispatcher = function() { |
|
139 | 139 | }; |
140 | 140 | } |
141 | 141 | |
142 | - return $this->dispatcher = function () use ($events) { |
|
142 | + return $this->dispatcher = function() use ($events) { |
|
143 | 143 | foreach ($events as $event) { |
144 | 144 | app('events')->dispatch(...$event); |
145 | 145 | } |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | { |
151 | 151 | $calls = $this->chain->calls; |
152 | 152 | |
153 | - if (! $calls) { |
|
154 | - return $this->caller = function () { |
|
153 | + if (!$calls) { |
|
154 | + return $this->caller = function() { |
|
155 | 155 | }; |
156 | 156 | } |
157 | 157 | |
158 | - return $this->caller = function () use ($calls) { |
|
158 | + return $this->caller = function() use ($calls) { |
|
159 | 159 | foreach ($calls as $call) { |
160 | 160 | app()->call(...$call); |
161 | 161 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | private function abortCallback($abort, $cb) |
166 | 166 | { |
167 | 167 | $this->chain->reset(); |
168 | - $responder = function () use ($abort) { |
|
168 | + $responder = function() use ($abort) { |
|
169 | 169 | abort(...$abort); |
170 | 170 | }; |
171 | 171 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | { |
34 | 34 | $gate = $this->defineNewGate($gate); |
35 | 35 | |
36 | - $this->chain->predicate = function (...$payload) use ($gate, $parameters) { |
|
36 | + $this->chain->predicate = function(...$payload) use ($gate, $parameters) { |
|
37 | 37 | return Gate::allows($gate, (array_merge($parameters, ...$payload))); |
38 | 38 | }; |
39 | 39 | |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | |
48 | 48 | public function thisMethodShouldAllow($callback, array $parameters = []): Otherwise |
49 | 49 | { |
50 | - $this->chain->predicate = function (...$payload) use ($callback, $parameters) { |
|
51 | - return (bool) app()->call($callback, array_merge($parameters, ...$payload)); |
|
50 | + $this->chain->predicate = function(...$payload) use ($callback, $parameters) { |
|
51 | + return (bool)app()->call($callback, array_merge($parameters, ...$payload)); |
|
52 | 52 | }; |
53 | 53 | |
54 | 54 | return app(Otherwise::class); |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | |
57 | 57 | public function thisValueShouldAllow($value) |
58 | 58 | { |
59 | - $this->chain->predicate = function () use ($value) { |
|
60 | - return (bool) $value; |
|
59 | + $this->chain->predicate = function() use ($value) { |
|
60 | + return (bool)$value; |
|
61 | 61 | }; |
62 | 62 | |
63 | 63 | return app(Otherwise::class); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | public function youShouldBeGuest(): Otherwise |
67 | 67 | { |
68 | - $this->chain->predicate = function () { |
|
68 | + $this->chain->predicate = function() { |
|
69 | 69 | return auth()->guest(); |
70 | 70 | }; |
71 | 71 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | public function sessionShouldHave($key): Otherwise |
76 | 76 | { |
77 | - $this->chain->predicate = function () use ($key) { |
|
77 | + $this->chain->predicate = function() use ($key) { |
|
78 | 78 | return session()->has($key); |
79 | 79 | }; |
80 | 80 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | public function youShouldBeLoggedIn(): Otherwise |
85 | 85 | { |
86 | - $this->chain->predicate = function () { |
|
86 | + $this->chain->predicate = function() { |
|
87 | 87 | return auth()->check(); |
88 | 88 | }; |
89 | 89 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | public function immediately() |
94 | 94 | { |
95 | - $this->chain->predicate = function () { |
|
95 | + $this->chain->predicate = function() { |
|
96 | 96 | return false; |
97 | 97 | }; |
98 | 98 |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | public function afterFiringEvent($event, $payload = [], $halt = false) |
57 | 57 | { |
58 | - $this->chain->eventFire($event, $payload , $halt); |
|
58 | + $this->chain->eventFire($event, $payload, $halt); |
|
59 | 59 | |
60 | 60 | return $this; |
61 | 61 | } |