@@ -6,19 +6,19 @@ |
||
6 | 6 | { |
7 | 7 | public static function register() |
8 | 8 | { |
9 | - if (! app()->offsetExists('debugbar')) { |
|
9 | + if (!app()->offsetExists('debugbar')) { |
|
10 | 10 | return; |
11 | 11 | } |
12 | 12 | |
13 | - app()->singleton('heyman.debugger', function () { |
|
13 | + app()->singleton('heyman.debugger', function() { |
|
14 | 14 | return new \DebugBar\DataCollector\MessagesCollector('HeyMan'); |
15 | 15 | }); |
16 | 16 | |
17 | 17 | app()->make('debugbar')->addCollector(app('heyman.debugger')); |
18 | 18 | |
19 | - \Event::listen('heyman_reaction_is_happening', function (...$debug) { |
|
20 | - resolve('heyman.debugger')->addMessage('HeyMan Rule Matched in file: '.$debug[0]); |
|
21 | - resolve('heyman.debugger')->addMessage('on line: '.$debug[1]); |
|
19 | + \Event::listen('heyman_reaction_is_happening', function(...$debug) { |
|
20 | + resolve('heyman.debugger')->addMessage('HeyMan Rule Matched in file: ' . $debug[0]); |
|
21 | + resolve('heyman.debugger')->addMessage('on line: ' . $debug[1]); |
|
22 | 22 | resolve('heyman.debugger')->addMessage($debug[2]); |
23 | 23 | }); |
24 | 24 | } |
@@ -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 | }; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public function startWatching($chainData) |
17 | 17 | { |
18 | - Route::matched(function (RouteMatched $eventObj) use ($chainData) { |
|
18 | + Route::matched(function(RouteMatched $eventObj) use ($chainData) { |
|
19 | 19 | $matchedRoute = $this->getMatchedRouteInto($eventObj); |
20 | 20 | $matchedCallbacks = []; |
21 | 21 | foreach ($matchedRoute as $info) { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $matchedRoute = [ |
50 | 50 | $eventObj->route->getName(), |
51 | 51 | $eventObj->route->getActionName(), |
52 | - $eventObj->request->method().$eventObj->route->uri, |
|
52 | + $eventObj->request->method() . $eventObj->route->uri, |
|
53 | 53 | ]; |
54 | 54 | |
55 | 55 | return array_filter($matchedRoute); |
@@ -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 |