1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-05 12:47:39 +02:00

Add scalar hints and return types to the ActivationStrategyInterface interface and its implementations.

This commit is contained in:
Kat
2018-07-17 17:25:17 +01:00
parent b6b455ed11
commit 10bef97dea
3 changed files with 3 additions and 3 deletions

View File

@@ -24,5 +24,5 @@ interface ActivationStrategyInterface
* @param array $record * @param array $record
* @return bool * @return bool
*/ */
public function isHandlerActivated(array $record); public function isHandlerActivated(array $record): bool;
} }

View File

@@ -48,7 +48,7 @@ class ChannelLevelActivationStrategy implements ActivationStrategyInterface
$this->channelToActionLevel = array_map('Monolog\Logger::toMonologLevel', $channelToActionLevel); $this->channelToActionLevel = array_map('Monolog\Logger::toMonologLevel', $channelToActionLevel);
} }
public function isHandlerActivated(array $record) public function isHandlerActivated(array $record): bool
{ {
if (isset($this->channelToActionLevel[$record['channel']])) { if (isset($this->channelToActionLevel[$record['channel']])) {
return $record['level'] >= $this->channelToActionLevel[$record['channel']]; return $record['level'] >= $this->channelToActionLevel[$record['channel']];

View File

@@ -27,7 +27,7 @@ class ErrorLevelActivationStrategy implements ActivationStrategyInterface
$this->actionLevel = Logger::toMonologLevel($actionLevel); $this->actionLevel = Logger::toMonologLevel($actionLevel);
} }
public function isHandlerActivated(array $record) public function isHandlerActivated(array $record): bool
{ {
return $record['level'] >= $this->actionLevel; return $record['level'] >= $this->actionLevel;
} }