@@ -12,8 +12,8 @@ discard block |
||
12 | 12 | $reaction = $this->makeReaction(); |
13 | 13 | $condition = resolve('heyman.chain')->get('condition'); |
14 | 14 | |
15 | - return function (...$f) use ($condition, $reaction) { |
|
16 | - if (! $condition($f)) { |
|
15 | + return function(...$f) use ($condition, $reaction) { |
|
16 | + if (!$condition($f)) { |
|
17 | 17 | $reaction(); |
18 | 18 | } |
19 | 19 | }; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | $responder = resolve(ResponderFactory::class)->make(); |
32 | 32 | |
33 | - return function () use ($beforeReaction, $responder, $debug, $termination) { |
|
33 | + return function() use ($beforeReaction, $responder, $debug, $termination) { |
|
34 | 34 | if ($termination) { |
35 | 35 | app()->terminating($termination); |
36 | 36 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | { |
50 | 50 | $tasks = $chain->get('beforeReaction') ?? []; |
51 | 51 | $tasks = $this->convertToClosures($tasks); |
52 | - $beforeReaction = function () use ($tasks) { |
|
52 | + $beforeReaction = function() use ($tasks) { |
|
53 | 53 | foreach ($tasks as $task) { |
54 | 54 | $task(); |
55 | 55 | } |
@@ -65,16 +65,16 @@ discard block |
||
65 | 65 | */ |
66 | 66 | private function convertToClosures($tasks): array |
67 | 67 | { |
68 | - $map = function ($task) { |
|
68 | + $map = function($task) { |
|
69 | 69 | $params = $task[0]; |
70 | 70 | |
71 | 71 | if ($task[1] == 'event') { |
72 | - return function () use ($params) { |
|
72 | + return function() use ($params) { |
|
73 | 73 | resolve('events')->dispatch(...$params); |
74 | 74 | }; |
75 | 75 | } |
76 | 76 | |
77 | - return function () use ($params) { |
|
77 | + return function() use ($params) { |
|
78 | 78 | app()->call(...$params); |
79 | 79 | }; |
80 | 80 | }; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | $args = $this->normalizeInput($args); |
32 | 32 | |
33 | 33 | if (in_array($method, ['aboutRoute', 'aboutAction', 'aboutUrl'])) { |
34 | - $args = resolve(RouteNormalizer::class)->{'normalize'.ltrim($method, 'about')}($args); |
|
34 | + $args = resolve(RouteNormalizer::class)->{'normalize' . ltrim($method, 'about')}($args); |
|
35 | 35 | |
36 | 36 | return resolve('heyman.chains')->forgetAbout(RouteEventListener::class, $args); |
37 | 37 | } |
@@ -12,8 +12,8 @@ discard block |
||
12 | 12 | { |
13 | 13 | $method = $this->aliases[$method] ?? $method; |
14 | 14 | |
15 | - if (! isset($this->methods[$method])) { |
|
16 | - throw new \BadMethodCallException($method.' does not exists as a Heyman condition'); |
|
15 | + if (!isset($this->methods[$method])) { |
|
16 | + throw new \BadMethodCallException($method . ' does not exists as a Heyman condition'); |
|
17 | 17 | } |
18 | 18 | $condition = $this->methods[$method]; |
19 | 19 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | public function alias(string $currentName, string $newName) |
39 | 39 | { |
40 | - if (isset($this->methods[$currentName]) && ! isset($this->aliases[$newName])) { |
|
40 | + if (isset($this->methods[$currentName]) && !isset($this->aliases[$newName])) { |
|
41 | 41 | $this->aliases[$newName] = $currentName; |
42 | 42 | } |
43 | 43 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | public function checkPoint(string $pointName) |
28 | 28 | { |
29 | - event('heyman_checkpoint_'.$pointName); |
|
29 | + event('heyman_checkpoint_' . $pointName); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | public function aliasCondition(string $currentName, string $newName) |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | private function writeDebugInfo($debugTrace) |
51 | 51 | { |
52 | - if (config('app.debug') && ! app()->environment('production')) { |
|
52 | + if (config('app.debug') && !app()->environment('production')) { |
|
53 | 53 | $info = array_only($debugTrace, ['file', 'line', 'args']); |
54 | 54 | resolve('heyman.chain')->set('debugInfo', $info); |
55 | 55 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | public function normalize($method, $name) |
14 | 14 | { |
15 | 15 | if ($method == 'whenYouReachCheckPoint') { |
16 | - $name[0] = 'heyman_checkpoint_'.$name[0]; |
|
16 | + $name[0] = 'heyman_checkpoint_' . $name[0]; |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | return [$name]; |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function normalize($method, $params) |
13 | 13 | { |
14 | - array_walk($params, function ($view) { |
|
14 | + array_walk($params, function($view) { |
|
15 | 15 | $this->checkViewExists($view); |
16 | 16 | }); |
17 | 17 |
@@ -13,12 +13,12 @@ discard block |
||
13 | 13 | */ |
14 | 14 | public function normalizeAction($actions): array |
15 | 15 | { |
16 | - $addNamespace = function ($action) { |
|
16 | + $addNamespace = function($action) { |
|
17 | 17 | if (Str::startsWith($action, '\\')) { |
18 | 18 | return $action; |
19 | 19 | } |
20 | 20 | |
21 | - return app()->getNamespace().'Http\\Controllers\\'.$action; |
|
21 | + return app()->getNamespace() . 'Http\\Controllers\\' . $action; |
|
22 | 22 | }; |
23 | 23 | |
24 | 24 | return array_map($addNamespace, $actions); |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function normalizeUrl($urls, $verb = 'GET'): array |
34 | 34 | { |
35 | - $removeSlash = function ($url) use ($verb) { |
|
36 | - return $verb.ltrim($url, '/'); |
|
35 | + $removeSlash = function($url) use ($verb) { |
|
36 | + return $verb . ltrim($url, '/'); |
|
37 | 37 | }; |
38 | 38 | |
39 | 39 | return array_map($removeSlash, $urls); |
@@ -55,7 +55,7 @@ |
||
55 | 55 | $matchedRoute = [ |
56 | 56 | $route->getName(), |
57 | 57 | $route->getActionName(), |
58 | - app('request')->method().$route->uri, |
|
58 | + app('request')->method() . $route->uri, |
|
59 | 59 | ]; |
60 | 60 | |
61 | 61 | return array_filter($matchedRoute); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | public function startWatching($chainData) |
16 | 16 | { |
17 | 17 | MatchedRoute::$chainData = $chainData; |
18 | - Route::matched(function (RouteMatched $eventObj) { |
|
18 | + Route::matched(function(RouteMatched $eventObj) { |
|
19 | 19 | $eventObj->route->middleware(MatchedRoute::class); |
20 | 20 | }); |
21 | 21 | } |