@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $cb = $this->chain->predicate; |
43 | 43 | $this->chain->reset(); |
44 | 44 | |
45 | - return function (...$f) use ($responder, $cb, $dispatcher, $calls) { |
|
45 | + return function(...$f) use ($responder, $cb, $dispatcher, $calls) { |
|
46 | 46 | if ($cb($f)) { |
47 | 47 | return true; |
48 | 48 | } |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | $events = $this->chain->events; |
59 | 59 | |
60 | 60 | if (!$events) { |
61 | - return function () { |
|
61 | + return function() { |
|
62 | 62 | }; |
63 | 63 | } |
64 | 64 | |
65 | - return function () use ($events) { |
|
65 | + return function() use ($events) { |
|
66 | 66 | foreach ($events as $event) { |
67 | 67 | app('events')->dispatch(...$event); |
68 | 68 | } |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | $calls = $this->chain->afterCalls; |
75 | 75 | |
76 | 76 | if (!$calls) { |
77 | - return function () { |
|
77 | + return function() { |
|
78 | 78 | }; |
79 | 79 | } |
80 | 80 | |
81 | - return function () use ($calls) { |
|
81 | + return function() use ($calls) { |
|
82 | 82 | foreach ($calls as $call) { |
83 | 83 | app()->call(...$call); |
84 | 84 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | public function abort($abort) |
27 | 27 | { |
28 | - return function () use ($abort) { |
|
28 | + return function() use ($abort) { |
|
29 | 29 | abort(...$abort[0]); |
30 | 30 | }; |
31 | 31 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function exception($e): \Closure |
45 | 45 | { |
46 | - return function () use ($e) { |
|
46 | + return function() use ($e) { |
|
47 | 47 | $exClass = $e[0]['class']; |
48 | 48 | |
49 | 49 | throw new $exClass($e[0]['message']); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function response($resp): \Closure |
59 | 59 | { |
60 | - return function () use ($resp) { |
|
60 | + return function() use ($resp) { |
|
61 | 61 | $respObj = response(); |
62 | 62 | foreach ($resp as $call) { |
63 | 63 | list($method, $args) = $call; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | public function redirect($resp): \Closure |
71 | 71 | { |
72 | - return function () use ($resp) { |
|
72 | + return function() use ($resp) { |
|
73 | 73 | $respObj = redirect(); |
74 | 74 | foreach ($resp as $call) { |
75 | 75 | list($method, $args) = $call; |
@@ -81,14 +81,14 @@ discard block |
||
81 | 81 | |
82 | 82 | public function respondFrom($method) |
83 | 83 | { |
84 | - return function () use ($method) { |
|
84 | + return function() use ($method) { |
|
85 | 85 | respondWith(app()->call(...$method[0])); |
86 | 86 | }; |
87 | 87 | } |
88 | 88 | |
89 | 89 | public function validatorCallback($rules): \Closure |
90 | 90 | { |
91 | - $validator = function () use ($rules) { |
|
91 | + $validator = function() use ($rules) { |
|
92 | 92 | if (is_callable($rules)) { |
93 | 93 | $rules = $rules(); |
94 | 94 | } |
@@ -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): Otherwise |
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($guard = null): Otherwise |
67 | 67 | { |
68 | - $this->chain->predicate = function () use ($guard) { |
|
68 | + $this->chain->predicate = function() use ($guard) { |
|
69 | 69 | return auth($guard)->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($guard = null): Otherwise |
85 | 85 | { |
86 | - $this->chain->predicate = function () use ($guard) { |
|
86 | + $this->chain->predicate = function() use ($guard) { |
|
87 | 87 | return auth($guard)->check(); |
88 | 88 | }; |
89 | 89 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | public function youShouldAlways(): Reactions |
94 | 94 | { |
95 | - $this->chain->predicate = function () { |
|
95 | + $this->chain->predicate = function() { |
|
96 | 96 | return false; |
97 | 97 | }; |
98 | 98 |