Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion bundle/Debug/DebugProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Monolog\LogRecord;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
use Symfony\Contracts\Service\ResetInterface;

use function call_user_func;
use function in_array;
Expand All @@ -19,7 +20,7 @@
* By default, it excludes "doctrine" and "event" channels, which cause most
* of the slowdown when rendering the profiler.
*/
final class DebugProcessor implements DebugLoggerInterface
final class DebugProcessor implements DebugLoggerInterface, ResetInterface
{
/**
* @param string[] $excludedChannels
Expand All @@ -29,9 +30,9 @@
private array $excludedChannels = ['event', 'doctrine'],
) {}

public function __invoke(LogRecord $record): LogRecord

Check failure on line 33 in bundle/Debug/DebugProcessor.php

View workflow job for this annotation

GitHub Actions / phpstan

Parameter $record of method Netgen\Bundle\SiteBundle\Debug\DebugProcessor::__invoke() has invalid type Monolog\LogRecord.

Check failure on line 33 in bundle/Debug/DebugProcessor.php

View workflow job for this annotation

GitHub Actions / phpstan

Method Netgen\Bundle\SiteBundle\Debug\DebugProcessor::__invoke() has invalid return type Monolog\LogRecord.
{
if (is_callable($this->innerProcessor) && !in_array($record->channel, $this->excludedChannels, true)) {

Check failure on line 35 in bundle/Debug/DebugProcessor.php

View workflow job for this annotation

GitHub Actions / phpstan

Access to property $channel on an unknown class Monolog\LogRecord.
call_user_func($this->innerProcessor, $record);
}

Expand All @@ -52,4 +53,9 @@
{
$this->innerProcessor->clear();
}

public function reset(): void

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably needs to implement Symfony\Contracts\Service\ResetInterface too.

{
$this->clear();
}
}
Loading