@@ -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 | } |
@@ -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 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | private function exceptionCallback($e): \Closure |
59 | 59 | { |
60 | - $responder = function () use ($e) { |
|
60 | + $responder = function() use ($e) { |
|
61 | 61 | $exClass = $e['class']; |
62 | 62 | throw new $exClass($e['message']); |
63 | 63 | }; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | private function responseCallback($resp): \Closure |
75 | 75 | { |
76 | - $responder = function () use ($resp) { |
|
76 | + $responder = function() use ($resp) { |
|
77 | 77 | $respObj = response(); |
78 | 78 | foreach ($resp as $call) { |
79 | 79 | list($method, $args) = $call; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | private function redirectCallback($resp): \Closure |
89 | 89 | { |
90 | - $responder = function () use ($resp) { |
|
90 | + $responder = function() use ($resp) { |
|
91 | 91 | $respObj = redirect(); |
92 | 92 | foreach ($resp as $call) { |
93 | 93 | list($method, $args) = $call; |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | $cb = $this->chain->predicate; |
112 | 112 | $this->chain->reset(); |
113 | 113 | |
114 | - $this->caller = $this->dispatcher = function () { |
|
114 | + $this->caller = $this->dispatcher = function() { |
|
115 | 115 | }; |
116 | - return function (...$f) use ($responder, $cb, $dispatcher, $calls) { |
|
116 | + return function(...$f) use ($responder, $cb, $dispatcher, $calls) { |
|
117 | 117 | if ($cb($f)) { |
118 | 118 | return true; |
119 | 119 | } |
@@ -128,12 +128,12 @@ discard block |
||
128 | 128 | { |
129 | 129 | $events = $this->chain->events; |
130 | 130 | |
131 | - if (! $events) { |
|
132 | - return $this->dispatcher = function () { |
|
131 | + if (!$events) { |
|
132 | + return $this->dispatcher = function() { |
|
133 | 133 | }; |
134 | 134 | } |
135 | 135 | |
136 | - return $this->dispatcher = function () use ($events) { |
|
136 | + return $this->dispatcher = function() use ($events) { |
|
137 | 137 | foreach ($events as $event) { |
138 | 138 | app('events')->dispatch(...$event); |
139 | 139 | } |
@@ -144,12 +144,12 @@ discard block |
||
144 | 144 | { |
145 | 145 | $calls = $this->chain->calls; |
146 | 146 | |
147 | - if (! $calls) { |
|
148 | - return $this->caller = function () { |
|
147 | + if (!$calls) { |
|
148 | + return $this->caller = function() { |
|
149 | 149 | }; |
150 | 150 | } |
151 | 151 | |
152 | - return $this->caller = function () use ($calls) { |
|
152 | + return $this->caller = function() use ($calls) { |
|
153 | 153 | foreach ($calls as $call) { |
154 | 154 | app()->call(...$call); |
155 | 155 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | |
159 | 159 | private function abortCallback($abort) |
160 | 160 | { |
161 | - $responder = function () use ($abort) { |
|
161 | + $responder = function() use ($abort) { |
|
162 | 162 | abort(...$abort); |
163 | 163 | }; |
164 | 164 |