Skip to content

Commit ba01352

Browse files
kevariablegithub-actions[bot]
authored andcommitted
Fix styling
1 parent 42a3283 commit ba01352

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

config/slack-logging.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323

2424
'environments' => [
2525
'production',
26-
'local'
26+
'local',
2727
],
2828
];

src/SlackLogging.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function getExceptionData(\Throwable $exception): array
7878
'COOKIE' => Request::cookie(),
7979
'SESSION' => Request::hasSession() ? Session::all() : [],
8080
'HEADERS' => Request::header(),
81-
'PARAMETERS' => $this->filterParameterValues(Request::all())
81+
'PARAMETERS' => $this->filterParameterValues(Request::all()),
8282
];
8383

8484
$data['storage'] = array_filter($data['storage']);
@@ -112,10 +112,6 @@ public function getExceptionData(\Throwable $exception): array
112112
return $data;
113113
}
114114

115-
/**
116-
* @param array $parameters
117-
* @return array
118-
*/
119115
public function filterParameterValues(array $parameters): array
120116
{
121117
return collect($parameters)->map(function ($value) {
@@ -138,9 +134,6 @@ public function shouldParameterValueBeFiltered(mixed $value): bool
138134
/**
139135
* Gets information from the line.
140136
*
141-
* @param $lines
142-
* @param $line
143-
* @param $i
144137
*
145138
* @return array|void
146139
*/
@@ -150,7 +143,7 @@ private function getLineInfo($lines, $line, $i)
150143

151144
$index = $currentLine - 1;
152145

153-
if (!array_key_exists($index, $lines)) {
146+
if (! array_key_exists($index, $lines)) {
154147
return;
155148
}
156149

@@ -160,10 +153,6 @@ private function getLineInfo($lines, $line, $i)
160153
];
161154
}
162155

163-
/**
164-
* @param $exceptionClass
165-
* @return bool
166-
*/
167156
public function isSkipException($exceptionClass): bool
168157
{
169158
return in_array($exceptionClass, config('slack-logging.except'));
@@ -194,7 +183,7 @@ private function logError($exception): void
194183
$block->field("*User:*\n{$this->getUser()['email']}")->markdown();
195184
}
196185
})
197-
->sectionBlock(function (SectionBlock $block) use ($exception, $date) {
186+
->sectionBlock(function (SectionBlock $block) use ($exception) {
198187
$block->text("*Error:*\n{$exception['error']}")->markdown();
199188
});
200189

@@ -212,7 +201,7 @@ public function isSleepingException(array $data): bool
212201

213202
private function createExceptionString(array $data): string
214203
{
215-
return 'slack-logging.' . Str::slug($data['host'] . '_' . $data['method'] . '_' . $data['exception'] . '_' . $data['line'] . '_' . $data['file'] . '_' . $data['class']);
204+
return 'slack-logging.'.Str::slug($data['host'].'_'.$data['method'].'_'.$data['exception'].'_'.$data['line'].'_'.$data['file'].'_'.$data['class']);
216205
}
217206

218207
public function getUser(): ?array
@@ -228,5 +217,4 @@ public function getUser(): ?array
228217

229218
return null;
230219
}
231-
232220
}

src/SlackLoggingHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Kevariable\SlackLogging;
44

5+
use Monolog\Handler\AbstractProcessingHandler;
56
use Monolog\Level;
67
use Throwable;
7-
use Monolog\Handler\AbstractProcessingHandler;
88

99
class SlackLoggingHandler extends AbstractProcessingHandler
1010
{

src/SlackLoggingServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function register(): void
2121
parent::register();
2222

2323
$this->app->singleton('slack-logging', function () {
24-
return new SlackLogging();
24+
return new SlackLogging;
2525
});
2626

2727
if ($this->app['log'] instanceof LogManager) {

0 commit comments

Comments
 (0)