From dc003d137ebed0e70124e23861e76f2fe9481d0a Mon Sep 17 00:00:00 2001 From: Kat Date: Tue, 17 Jul 2018 17:32:33 +0100 Subject: [PATCH] Add docblocks and return type to the FingersCrossed strategy classes. --- .../FingersCrossed/ChannelLevelActivationStrategy.php | 9 ++++++++- .../FingersCrossed/ErrorLevelActivationStrategy.php | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php b/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php index 8d0e4a2e..56681c11 100644 --- a/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php +++ b/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php @@ -35,14 +35,21 @@ use Monolog\Logger; */ class ChannelLevelActivationStrategy implements ActivationStrategyInterface { + /** + * @var string|int + */ private $defaultActionLevel; + + /** + * @var array + */ private $channelToActionLevel; /** * @param int $defaultActionLevel The default action level to be used if the record's category doesn't match any * @param array $channelToActionLevel An array that maps channel names to action levels. */ - public function __construct($defaultActionLevel, $channelToActionLevel = []) + public function __construct($defaultActionLevel, array $channelToActionLevel = []) { $this->defaultActionLevel = Logger::toMonologLevel($defaultActionLevel); $this->channelToActionLevel = array_map('Monolog\Logger::toMonologLevel', $channelToActionLevel); diff --git a/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php b/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php index 5a2a7991..7c0eb6ae 100644 --- a/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php +++ b/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php @@ -20,13 +20,23 @@ use Monolog\Logger; */ class ErrorLevelActivationStrategy implements ActivationStrategyInterface { + /** + * @var string|int + */ private $actionLevel; + /** + * @param string|int $actionLevel + */ public function __construct($actionLevel) { $this->actionLevel = Logger::toMonologLevel($actionLevel); } + /** + * @param array $record + * @return bool + */ public function isHandlerActivated(array $record): bool { return $record['level'] >= $this->actionLevel;