@@ -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)); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | { |
11 | 11 | public function authorizeMatchedRoutes() |
12 | 12 | { |
13 | - Route::matched(function (RouteMatched $eventObj) { |
|
13 | + Route::matched(function(RouteMatched $eventObj) { |
|
14 | 14 | $route = $eventObj->route; |
15 | 15 | if ($eventObj->request->method() === 'GET') { |
16 | 16 | $this->authorizeUrls($route->uri); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | private function setGuardFor($method, $key) |
58 | 58 | { |
59 | - $method = 'get'.$method; |
|
59 | + $method = 'get' . $method; |
|
60 | 60 | app(RouterEventManager::class)->{$method}($key)(); |
61 | 61 | } |
62 | 62 | } |
@@ -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->calls; |
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 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public function abortCallback($abort) |
33 | 33 | { |
34 | - $responder = function () use ($abort) { |
|
34 | + $responder = function() use ($abort) { |
|
35 | 35 | abort(...$abort); |
36 | 36 | }; |
37 | 37 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function exceptionCallback($e): \Closure |
48 | 48 | { |
49 | - $responder = function () use ($e) { |
|
49 | + $responder = function() use ($e) { |
|
50 | 50 | $exClass = $e['class']; |
51 | 51 | |
52 | 52 | throw new $exClass($e['message']); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function responseCallback($resp): \Closure |
65 | 65 | { |
66 | - $responder = function () use ($resp) { |
|
66 | + $responder = function() use ($resp) { |
|
67 | 67 | $respObj = response(); |
68 | 68 | foreach ($resp as $call) { |
69 | 69 | list($method, $args) = $call; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | public function redirectCallback($resp): \Closure |
79 | 79 | { |
80 | - $responder = function () use ($resp) { |
|
80 | + $responder = function() use ($resp) { |
|
81 | 81 | $respObj = redirect(); |
82 | 82 | foreach ($resp as $call) { |
83 | 83 | list($method, $args) = $call; |
@@ -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() |
93 | 93 | { |
94 | - $this->chain->predicate = function () { |
|
94 | + $this->chain->predicate = function() { |
|
95 | 95 | return false; |
96 | 96 | }; |
97 | 97 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | { |
39 | 39 | $views = $this->normalizeInput($views); |
40 | 40 | |
41 | - $mapper = function ($view) { |
|
41 | + $mapper = function($view) { |
|
42 | 42 | $this->checkViewExists($view); |
43 | 43 | }; |
44 | 44 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function startGuarding(callable $callback) |
27 | 27 | { |
28 | - $callback = function (...$args) use ($callback) { |
|
28 | + $callback = function(...$args) use ($callback) { |
|
29 | 29 | if (!config('heyman_ignore_view', false)) { |
30 | 30 | $callback(...$args); |
31 | 31 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | */ |
30 | 30 | public function startGuarding(callable $callback) |
31 | 31 | { |
32 | - $c = function (...$args) use ($callback) { |
|
32 | + $c = function(...$args) use ($callback) { |
|
33 | 33 | if (!config('heyman_ignore_eloquent', false)) { |
34 | 34 | $callback(...$args); |
35 | 35 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
80 | - return function () { |
|
80 | + return function() { |
|
81 | 81 | }; |
82 | 82 | } |
83 | 83 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | private function wrapCallbackForIgnore($callback): \Closure |
90 | 90 | { |
91 | - return function () use ($callback) { |
|
91 | + return function() use ($callback) { |
|
92 | 92 | if (!config('heyman_ignore_route', false)) { |
93 | 93 | $callback(); |
94 | 94 | } |