@@ -64,7 +64,7 @@ |
||
64 | 64 | $this->events[] = [$event, $payload, $halt]; |
65 | 65 | } |
66 | 66 | |
67 | - public function addRespondFrom($callback,array $parameters) |
|
67 | + public function addRespondFrom($callback, array $parameters) |
|
68 | 68 | { |
69 | 69 | $this->respondFrom = [$callback, $parameters]; |
70 | 70 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $gate = $this->defineNewGate($gate); |
34 | 34 | |
35 | - $this->chain->predicate = function (...$payload) use ($gate, $parameters) { |
|
35 | + $this->chain->predicate = function(...$payload) use ($gate, $parameters) { |
|
36 | 36 | return Gate::allows($gate, (array_merge($parameters, ...$payload))); |
37 | 37 | }; |
38 | 38 | |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | |
47 | 47 | public function thisMethodShouldAllow($callback, array $parameters = []): Otherwise |
48 | 48 | { |
49 | - $this->chain->predicate = function (...$payload) use ($callback, $parameters) { |
|
50 | - return (bool) app()->call($callback, array_merge($parameters, ...$payload)); |
|
49 | + $this->chain->predicate = function(...$payload) use ($callback, $parameters) { |
|
50 | + return (bool)app()->call($callback, array_merge($parameters, ...$payload)); |
|
51 | 51 | }; |
52 | 52 | |
53 | 53 | return app(Otherwise::class); |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | |
56 | 56 | public function thisValueShouldAllow($value): Otherwise |
57 | 57 | { |
58 | - $this->chain->predicate = function () use ($value) { |
|
59 | - return (bool) $value; |
|
58 | + $this->chain->predicate = function() use ($value) { |
|
59 | + return (bool)$value; |
|
60 | 60 | }; |
61 | 61 | |
62 | 62 | return app(Otherwise::class); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | public function youShouldBeGuest($guard = null): Otherwise |
66 | 66 | { |
67 | - $this->chain->predicate = function () use ($guard) { |
|
67 | + $this->chain->predicate = function() use ($guard) { |
|
68 | 68 | return auth($guard)->guest(); |
69 | 69 | }; |
70 | 70 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | public function sessionShouldHave($key): Otherwise |
75 | 75 | { |
76 | - $this->chain->predicate = function () use ($key) { |
|
76 | + $this->chain->predicate = function() use ($key) { |
|
77 | 77 | return session()->has($key); |
78 | 78 | }; |
79 | 79 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | public function youShouldBeLoggedIn($guard = null): Otherwise |
84 | 84 | { |
85 | - $this->chain->predicate = function () use ($guard) { |
|
85 | + $this->chain->predicate = function() use ($guard) { |
|
86 | 86 | return auth($guard)->check(); |
87 | 87 | }; |
88 | 88 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | public function youShouldAlways(): Reactions |
93 | 93 | { |
94 | - $this->chain->predicate = function () { |
|
94 | + $this->chain->predicate = function() { |
|
95 | 95 | return false; |
96 | 96 | }; |
97 | 97 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function yourRequestShouldBeValid($rules) |
107 | 107 | { |
108 | - $validator = function () use ($rules) { |
|
108 | + $validator = function() use ($rules) { |
|
109 | 109 | if (is_callable($rules)) { |
110 | 110 | $rules = $rules(); |
111 | 111 | } |
@@ -29,14 +29,14 @@ discard block |
||
29 | 29 | } elseif ($this->chain->respondFrom) { |
30 | 30 | return $this->respondFrom($this->chain->respondFrom); |
31 | 31 | } else { |
32 | - return function () { |
|
32 | + return function() { |
|
33 | 33 | }; |
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
37 | 37 | public function abortCallback($abort) |
38 | 38 | { |
39 | - $responder = function () use ($abort) { |
|
39 | + $responder = function() use ($abort) { |
|
40 | 40 | abort(...$abort); |
41 | 41 | }; |
42 | 42 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function exceptionCallback($e): \Closure |
53 | 53 | { |
54 | - $responder = function () use ($e) { |
|
54 | + $responder = function() use ($e) { |
|
55 | 55 | $exClass = $e['class']; |
56 | 56 | |
57 | 57 | throw new $exClass($e['message']); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function responseCallback($resp): \Closure |
69 | 69 | { |
70 | - $responder = function () use ($resp) { |
|
70 | + $responder = function() use ($resp) { |
|
71 | 71 | $respObj = response(); |
72 | 72 | foreach ($resp as $call) { |
73 | 73 | list($method, $args) = $call; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | public function redirectCallback($resp): \Closure |
83 | 83 | { |
84 | - $responder = function () use ($resp) { |
|
84 | + $responder = function() use ($resp) { |
|
85 | 85 | $respObj = redirect(); |
86 | 86 | foreach ($resp as $call) { |
87 | 87 | list($method, $args) = $call; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | public function respondFrom($method) |
97 | 97 | { |
98 | - return function () use ($method) { |
|
98 | + return function() use ($method) { |
|
99 | 99 | respondWith(app()->call(...$method)); |
100 | 100 | }; |
101 | 101 | } |