@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | $routes = app()->router->getRoutes(); |
36 | 36 | $routeIdentifier = $request->method().$request->getPathInfo(); |
37 | 37 | |
38 | - if (! array_key_exists($routeIdentifier, $routes)) { |
|
38 | + if (!array_key_exists($routeIdentifier, $routes)) { |
|
39 | 39 | return; |
40 | 40 | } |
41 | 41 | |
42 | 42 | $routeDetails = $routes[$routeIdentifier]['action']; |
43 | 43 | |
44 | - if (! isset($routeDetails['uses']) && ! empty($routeDetails[0])) { |
|
44 | + if (!isset($routeDetails['uses']) && !empty($routeDetails[0])) { |
|
45 | 45 | $this->honeybadger->setComponent(get_class($routeDetails[0])); |
46 | 46 | |
47 | 47 | return; |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | |
50 | 50 | $routeAction = explode('@', $routeDetails['uses']); |
51 | 51 | |
52 | - if (! empty($routeAction[0])) { |
|
52 | + if (!empty($routeAction[0])) { |
|
53 | 53 | $this->honeybadger->setComponent($routeAction[0] ?? ''); |
54 | 54 | } |
55 | 55 | |
56 | - if (! empty($routeAction[1])) { |
|
56 | + if (!empty($routeAction[1])) { |
|
57 | 57 | $this->honeybadger->setAction($routeAction[1] ?? ''); |
58 | 58 | } |
59 | 59 | } |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | if (Route::getCurrentRoute()) { |
64 | 64 | $routeAction = explode('@', Route::getCurrentRoute()->getActionName()); |
65 | 65 | |
66 | - if (! empty($routeAction[0])) { |
|
66 | + if (!empty($routeAction[0])) { |
|
67 | 67 | $this->honeybadger->setComponent($routeAction[0] ?? ''); |
68 | 68 | } |
69 | 69 | |
70 | - if (! empty($routeAction[1])) { |
|
70 | + if (!empty($routeAction[1])) { |
|
71 | 71 | $this->honeybadger->setAction($routeAction[1] ?? ''); |
72 | 72 | } |
73 | 73 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | $honeybadger = app('honeybadger.loud'); |
30 | 30 | |
31 | 31 | try { |
32 | - if (! config('honeybadger.report_data')) { |
|
32 | + if (!config('honeybadger.report_data')) { |
|
33 | 33 | $this->info("You have `report_data` set to false in your config. Errors won't be reported in this environment."); |
34 | 34 | $this->info("We've switched it to true for this test, but you should check that it's enabled for your production environments."); |
35 | 35 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | if ($this->installer->shouldPublishConfig()) { |
64 | 64 | $this->tasks->addTask( |
65 | 65 | 'Publish the config file', |
66 | - function () { |
|
66 | + function() { |
|
67 | 67 | return $this->publishConfig(); |
68 | 68 | } |
69 | 69 | ); |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | |
113 | 113 | $this->tasks->addTask( |
114 | 114 | 'Send test exception to Honeybadger', |
115 | - function () { |
|
116 | - if (! config('honeybadger.report_data')) { |
|
115 | + function() { |
|
116 | + if (!config('honeybadger.report_data')) { |
|
117 | 117 | $this->info("You have `report_data` set to false in your config. Errors won't be reported in this environment."); |
118 | 118 | $this->info("We've switched it to true for this test, but you should check that it's enabled for your production environments."); |
119 | 119 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | { |
135 | 135 | $this->tasks->addTask( |
136 | 136 | 'Write HONEYBADGER_API_KEY to .env', |
137 | - function () { |
|
137 | + function() { |
|
138 | 138 | return $this->installer->writeConfig( |
139 | 139 | [ |
140 | 140 | 'HONEYBADGER_API_KEY' => $this->config['api_key'], |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | $this->tasks->addTask( |
149 | 149 | 'Write HONEYBADGER_API_KEY placeholder to .env.example', |
150 | - function () { |
|
150 | + function() { |
|
151 | 151 | return $this->installer->writeConfig( |
152 | 152 | [ |
153 | 153 | 'HONEYBADGER_API_KEY' => '', |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | $this->tasks->addTask( |
162 | 162 | 'Write HONEYBADGER_VERIFY_SSL placeholder to .env.example', |
163 | - function () { |
|
163 | + function() { |
|
164 | 164 | return $this->installer->writeConfig( |
165 | 165 | ['HONEYBADGER_VERIFY_SSL' => ''], |
166 | 166 | base_path('.env.example') |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function runTasks(): void |
65 | 65 | { |
66 | - Collection::make($this->tasks)->each(function ($task, $description) { |
|
66 | + Collection::make($this->tasks)->each(function($task, $description) { |
|
67 | 67 | $result = $task['task'](); |
68 | 68 | |
69 | 69 | if ($this->output) { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | $this->results[$description] = $result; |
77 | 77 | |
78 | - if (! $result && $task['throw_on_fail'] && $this->throwOnError) { |
|
78 | + if (!$result && $task['throw_on_fail'] && $this->throwOnError) { |
|
79 | 79 | throw new TaskFailed(sprintf('%s failed, please review output and try again.', $description)); |
80 | 80 | } |
81 | 81 | }); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | return false; |
23 | 23 | } |
24 | 24 | |
25 | - collect($config)->each(function ($value, $key) use ($env) { |
|
25 | + collect($config)->each(function($value, $key) use ($env) { |
|
26 | 26 | $env->set($key, $value); |
27 | 27 | }); |
28 | 28 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function shouldPublishConfig(): bool |
54 | 54 | { |
55 | - return ! file_exists(base_path('config/honeybadger.php')); |
|
55 | + return !file_exists(base_path('config/honeybadger.php')); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function publishLumenConfig(string $stubPath = null): bool |
62 | 62 | { |
63 | - if (! is_dir(base_path('config'))) { |
|
63 | + if (!is_dir(base_path('config'))) { |
|
64 | 64 | mkdir(base_path('config')); |
65 | 65 | } |
66 | 66 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | { |
11 | 11 | public function __invoke(array $config): Logger |
12 | 12 | { |
13 | - return tap(new Logger($config['name'] ?? 'honeybadger'), function ($logger) { |
|
13 | + return tap(new Logger($config['name'] ?? 'honeybadger'), function($logger) { |
|
14 | 14 | $logger->pushHandler(App::make(LogHandler::class)); |
15 | 15 | }); |
16 | 16 | } |
@@ -47,17 +47,17 @@ discard block |
||
47 | 47 | |
48 | 48 | $this->registerReporters(); |
49 | 49 | |
50 | - $this->app->bind(LogHandler::class, function ($app) { |
|
50 | + $this->app->bind(LogHandler::class, function($app) { |
|
51 | 51 | return new LogHandler($app[Reporter::class]); |
52 | 52 | }); |
53 | 53 | |
54 | - $this->app->singleton('honeybadger.isLumen', function () { |
|
54 | + $this->app->singleton('honeybadger.isLumen', function() { |
|
55 | 55 | return preg_match('/lumen/i', $this->app->version()); |
56 | 56 | }); |
57 | 57 | |
58 | 58 | $this->app->when(HoneybadgerDeployCommand::class) |
59 | 59 | ->needs(Client::class) |
60 | - ->give(function () { |
|
60 | + ->give(function() { |
|
61 | 61 | return new Client([ |
62 | 62 | 'http_errors' => false, |
63 | 63 | ]); |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | private function registerEventHooks() |
110 | 110 | { |
111 | 111 | /** @param string|array|null $environments */ |
112 | - Event::macro('thenPingHoneybadger', function (string $id, $environments = null) { |
|
113 | - return $this->then(function () use ($id, $environments) { |
|
112 | + Event::macro('thenPingHoneybadger', function(string $id, $environments = null) { |
|
113 | + return $this->then(function() use ($id, $environments) { |
|
114 | 114 | if ($environments === null || app()->environment($environments)) { |
115 | 115 | app(Reporter::class)->checkin($id); |
116 | 116 | } |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | }); |
119 | 119 | |
120 | 120 | /** @param string|array|null $environments */ |
121 | - Event::macro('pingHoneybadgerOnSuccess', function (string $id, $environments = null) { |
|
122 | - return $this->onSuccess(function () use ($id, $environments) { |
|
121 | + Event::macro('pingHoneybadgerOnSuccess', function(string $id, $environments = null) { |
|
122 | + return $this->onSuccess(function() use ($id, $environments) { |
|
123 | 123 | if ($environments === null || app()->environment($environments)) { |
124 | 124 | app(Reporter::class)->checkin($id); |
125 | 125 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | { |
132 | 132 | // Views are not enabled on Lumen by default |
133 | 133 | if (app()->bound('blade.compiler')) { |
134 | - Blade::directive('honeybadgerError', function ($options) { |
|
134 | + Blade::directive('honeybadgerError', function($options) { |
|
135 | 135 | if ($options === '') { |
136 | 136 | $options = '[]'; |
137 | 137 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | return "<?php echo \$__env->make('honeybadger::informer', $options, $defaults)->render(); ?>"; |
142 | 142 | }); |
143 | 143 | |
144 | - Blade::directive('honeybadgerFeedback', function () { |
|
144 | + Blade::directive('honeybadgerFeedback', function() { |
|
145 | 145 | $action = rtrim(Honeybadger::API_URL, '/').'/feedback'; |
146 | 146 | |
147 | 147 | return "<?php echo \$__env->make('honeybadger::feedback', ['action' => '$action'])->render(); ?>"; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | |
177 | 177 | protected function registerReporters(): void |
178 | 178 | { |
179 | - $this->app->singleton(Reporter::class, function ($app) { |
|
179 | + $this->app->singleton(Reporter::class, function($app) { |
|
180 | 180 | return HoneybadgerLaravel::make($app['config']['honeybadger']); |
181 | 181 | }); |
182 | 182 | |
@@ -186,9 +186,9 @@ discard block |
||
186 | 186 | // In some cases (like the test command), we definitely want to throw any errors |
187 | 187 | // Laravel's contextual binding doesn't support method injection, |
188 | 188 | // so the handle() method will have to request this client specifically. |
189 | - $this->app->singleton('honeybadger.loud', function ($app) { |
|
189 | + $this->app->singleton('honeybadger.loud', function($app) { |
|
190 | 190 | $config = $app['config']['honeybadger']; |
191 | - $config['service_exception_handler'] = function (ServiceException $e) { |
|
191 | + $config['service_exception_handler'] = function(ServiceException $e) { |
|
192 | 192 | throw $e; |
193 | 193 | }; |
194 | 194 |
@@ -25,9 +25,9 @@ |
||
25 | 25 | |
26 | 26 | private function formatCommand(string $command, array $parameters) |
27 | 27 | { |
28 | - $parameters = collect($parameters)->map(function ($parameter) { |
|
28 | + $parameters = collect($parameters)->map(function($parameter) { |
|
29 | 29 | if (is_array($parameter)) { |
30 | - return collect($parameter)->map(function ($value, $key) { |
|
30 | + return collect($parameter)->map(function($value, $key) { |
|
31 | 31 | if (is_array($value)) { |
32 | 32 | return json_encode($value); |
33 | 33 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | public function handleEvent(string $eventName, array $data = []) |
13 | 13 | { |
14 | - if (! empty($data)) { |
|
14 | + if (!empty($data)) { |
|
15 | 15 | /** @var \Illuminate\View\View $view */ |
16 | 16 | $view = $data[0]; |
17 | 17 | $metadata = [ |