1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 09:06:10 +02:00

Bump phpstan to level 8

This commit is contained in:
Jordi Boggiano
2021-07-04 14:03:55 +02:00
parent 4ef5da80ad
commit 8b5278d8e1
47 changed files with 262 additions and 101 deletions

View File

@@ -36,7 +36,7 @@ class SamplingHandler extends AbstractHandler implements ProcessableHandlerInter
/**
* @var HandlerInterface|callable
* @phpstan-var HandlerInterface|callable(Record, HandlerInterface): HandlerInterface
* @phpstan-var HandlerInterface|callable(Record|array{level: Level}|null, HandlerInterface): HandlerInterface
*/
protected $handler;
@@ -46,7 +46,7 @@ class SamplingHandler extends AbstractHandler implements ProcessableHandlerInter
protected $factor;
/**
* @psalm-param HandlerInterface|callable(Record, HandlerInterface): HandlerInterface $handler
* @psalm-param HandlerInterface|callable(Record|array{level: Level}|null, HandlerInterface): HandlerInterface $handler
*
* @param callable|HandlerInterface $handler Handler or factory callable($record|null, $samplingHandler).
* @param int $factor Sample factor (e.g. 10 means every ~10th record is sampled)
@@ -71,6 +71,7 @@ class SamplingHandler extends AbstractHandler implements ProcessableHandlerInter
{
if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) {
if ($this->processors) {
/** @var Record $record */
$record = $this->processRecord($record);
}