From 508df120fac348c1e7ed6e590d83c549fa95434e Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 8 Apr 2022 17:32:03 +0200 Subject: [PATCH] Make AsMonologProcessor compatible with PHP 7.2 --- src/Monolog/Attribute/AsMonologProcessor.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Monolog/Attribute/AsMonologProcessor.php b/src/Monolog/Attribute/AsMonologProcessor.php index b52d07761..188bbb0d8 100644 --- a/src/Monolog/Attribute/AsMonologProcessor.php +++ b/src/Monolog/Attribute/AsMonologProcessor.php @@ -22,15 +22,25 @@ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class AsMonologProcessor { + /** @var string|null */ + public $channel = null; + /** @var string|null */ + public $handler = null; + /** @var string|null */ + public $method = null; + /** * @param string|null $channel The logging channel the processor should be pushed to. * @param string|null $handler The handler the processor should be pushed to. * @param string|null $method The method that processes the records (if the attribute is used at the class level). */ public function __construct( - public ?string $channel = null, - public ?string $handler = null, - public ?string $method = null, + ?string $channel = null, + ?string $handler = null, + ?string $method = null ) { + $this->channel = $channel; + $this->handler = $handler; + $this->method = $method; } -} \ No newline at end of file +}