Skip to content
Snippets Groups Projects
Commit d8dff112 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Fix Psalm-issues in Logger.php

parent 750403d9
No related branches found
No related tags found
No related merge requests found
...@@ -13,9 +13,9 @@ namespace SimpleSAML; ...@@ -13,9 +13,9 @@ namespace SimpleSAML;
class Logger class Logger
{ {
/** /**
* @var \SimpleSAML\Logger\LoggingHandlerInterface|false|null * @var \SimpleSAML\Logger\LoggingHandlerInterface|false
*/ */
private static $loggingHandler = null; private static $loggingHandler;
/** /**
* @var integer|null * @var integer|null
...@@ -439,12 +439,14 @@ class Logger ...@@ -439,12 +439,14 @@ class Logger
} }
$handler = $known_handlers[$handler]; $handler = $known_handlers[$handler];
} }
/** @var \SimpleSAML\Logger\LoggingHandlerInterface */
self::$loggingHandler = new $handler($config); self::$loggingHandler = new $handler($config);
self::$format = $config->getString('logging.format', self::$format); self::$format = $config->getString('logging.format', self::$format);
self::$loggingHandler->setLogFormat(self::$format); self::$loggingHandler->setLogFormat(self::$format);
} }
/** /**
* @param int $level * @param int $level
* @param string $string * @param string $string
...@@ -460,7 +462,7 @@ class Logger ...@@ -460,7 +462,7 @@ class Logger
} elseif (php_sapi_name() === 'cli' || defined('STDIN')) { } elseif (php_sapi_name() === 'cli' || defined('STDIN')) {
// we are being executed from the CLI, nowhere to log // we are being executed from the CLI, nowhere to log
if (is_null(self::$loggingHandler)) { if (is_null(self::$loggingHandler)) {
self::createLoggingHandler('SimpleSAML\Logger\StandardErrorLoggingHandler'); self::createLoggingHandler(\SimpleSAML\Logger\StandardErrorLoggingHandler::class);
} }
$_SERVER['REMOTE_ADDR'] = "CLI"; $_SERVER['REMOTE_ADDR'] = "CLI";
if (self::$trackid === self::NO_TRACKID) { if (self::$trackid === self::NO_TRACKID) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment