1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-24 01:56:18 +02:00

Static analysis improvements (#1475)

* Static analysis improvements

* Fix review issues
This commit is contained in:
Mponos George
2020-07-08 22:40:29 +03:00
committed by GitHub
parent 84342aa0a3
commit 53e2c97b0b
8 changed files with 20 additions and 1 deletions

View File

@@ -139,13 +139,16 @@ class TestHandler extends AbstractProcessingHandler
*/
public function hasRecordThatMatches(string $regex, $level): bool
{
return $this->hasRecordThatPasses(function ($rec) use ($regex) {
return $this->hasRecordThatPasses(function (array $rec) use ($regex): bool {
return preg_match($regex, $rec['message']) > 0;
}, $level);
}
/**
* @psalm-param callable(array, int): mixed $predicate
*
* @param string|int $level Logging level value or name
* @return bool
*/
public function hasRecordThatPasses(callable $predicate, $level)
{