Skip to content

Commit

Permalink
Code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sunkan committed Dec 3, 2024
1 parent 852005b commit 84b86a9
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Filters/TimeLimitFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class TimeLimitFilter implements FilterInterface

public function __construct(
private readonly CacheInterface $cache,
private readonly \DateInterval $interval
private readonly \DateInterval $interval,
) {}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/Handler/BugsnagHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(
private readonly Level $realLevel = Level::Error,
bool $bubble = true,
private readonly bool $includeContext = false,
private readonly bool $addBreadCrumbs = false
private readonly bool $addBreadCrumbs = false,
) {
parent::__construct($addBreadCrumbs ? Level::Debug : $this->realLevel, $bubble);
$this->client->registerCallback([$this, 'cleanStacktrace']);
Expand Down Expand Up @@ -128,7 +128,8 @@ public function cleanStacktrace(Report $report): void
$stacktrace->removeFrame(0);

// Remove all the trace about Monolog and Stefna\Logger as it's not interesting
while (str_starts_with($stacktrace->getFrames()[0]['method'], 'Monolog\\') ||
while (
str_starts_with($stacktrace->getFrames()[0]['method'], 'Monolog\\') ||
str_starts_with($stacktrace->getFrames()[0]['method'], 'Stefna\\Logger\\')
) {
$stacktrace->removeFrame(0);
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/DatadogHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(
private readonly string $apiEndpoint = self::DATADOG_LOG_HOST,
private readonly Level $realLevel = Level::Error,
bool $bubble = true,
private readonly bool $addBreadCrumbs = false
private readonly bool $addBreadCrumbs = false,
) {
parent::__construct($this->addBreadCrumbs ? Level::Debug : $this->realLevel, $bubble);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Logger/BufferFilterLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class BufferFilterLogger extends BufferLogger

public function __construct(
private readonly LoggerInterface $logger,
FilterInterface ...$filters
FilterInterface ...$filters,
) {
$this->filters = $filters;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Logger/ConsoleLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private function interpolate(string $message, array $context): string
return $message;
}

return $message . ': ' . json_encode($context, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
return $message . ': ' . json_encode($context, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
}

public function setOutput(OutputInterface $output): void
Expand Down
2 changes: 1 addition & 1 deletion src/Logger/FilterLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class FilterLogger extends AbstractLogger

public function __construct(
private readonly LoggerInterface $logger,
FilterInterface ...$filters
FilterInterface ...$filters,
) {
$this->filters = $filters;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Logger/ProcessLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class ProcessLogger extends AbstractLogger

public function __construct(
private readonly LoggerInterface $logger,
callable ...$processors
callable ...$processors,
) {
$this->processors = $processors;
}
Expand Down
1 change: 0 additions & 1 deletion src/Logger/SimpleFileLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
class SimpleFileLogger extends AbstractLogger
{

public function __construct(
private readonly string $filePath,
) {}
Expand Down
3 changes: 2 additions & 1 deletion src/Processor/StripContextProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ private function processContext(array $context): array
unset($context[$key]);
continue 2;
}
if ($pos !== false &&
if (
$pos !== false &&
$field['type'] === 'ending' &&
str_ends_with($searchKey, $field['field'])
) {
Expand Down

0 comments on commit 84b86a9

Please sign in to comment.