ソースを参照

Merge pull request #881 from aryeguy/patch-1

Added return type annotation
Jordi Boggiano 9 年 前
コミット
cb88cc82de
1 ファイル変更2 行追加3 行削除
  1. 2 3
      src/Monolog/Registry.php

+ 2 - 3
src/Monolog/Registry.php

@@ -68,7 +68,7 @@ class Registry
      *
      * @param string|Logger $logger Name or logger instance
      */
-    public static function hasLogger($logger)
+    public static function hasLogger($logger): bool
     {
         if ($logger instanceof Logger) {
             $index = array_search($logger, self::$loggers, true);
@@ -108,9 +108,8 @@ class Registry
      *
      * @param  string                    $name Name of the requested Logger instance
      * @throws \InvalidArgumentException If named Logger instance is not in the registry
-     * @return Logger                    Requested instance of Logger
      */
-    public static function getInstance($name)
+    public static function getInstance($name): Logger
     {
         if (!isset(self::$loggers[$name])) {
             throw new InvalidArgumentException(sprintf('Requested "%s" logger instance is not in the registry', $name));