mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 04:37:38 +02:00
Add scalar hints and return types to the ActivationStrategyInterface interface and its implementations.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
@@ -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']];
|
||||||
|
@@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user