Explorar o código

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

Kat %!s(int64=7) %!d(string=hai) anos
pai
achega
10bef97dea

+ 1 - 1
src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php

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

+ 1 - 1
src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php

@@ -48,7 +48,7 @@ class ChannelLevelActivationStrategy implements ActivationStrategyInterface
         $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']])) {
             return $record['level'] >= $this->channelToActionLevel[$record['channel']];

+ 1 - 1
src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php

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