From e659a0314086dd700dbe5e754e383ab758725805 Mon Sep 17 00:00:00 2001 From: Philipp Date: Mon, 17 Jul 2023 20:20:21 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Hypolite Petovan --- bin/daemon.php | 2 +- bin/worker.php | 2 +- src/Core/Addon/Exception/AddonInvalidConfigFileException.php | 2 +- src/Core/Hooks/Exceptions/HookConfigException.php | 2 +- src/Core/Logger/Exception/LogLevelException.php | 2 +- src/Core/Logger/Exception/LoggerArgumentException.php | 2 +- src/Core/Logger/Exception/LoggerException.php | 2 +- src/Core/Logger/Exception/LoggerUnusableException.php | 2 +- src/Core/Logger/Factory/AbstractLoggerTypeFactory.php | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/daemon.php b/bin/daemon.php index 317798a1d..11bad2b11 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -63,7 +63,7 @@ $dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config /** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */ $addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class); $dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies')); -$dice = $dice->addRule(LoggerInterface::class,['constructParams' => [Logger\Capabilities\LogChannel::DAEMON]]); +$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [Logger\Capabilities\LogChannel::DAEMON]]); DI::init($dice); \Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class)); diff --git a/bin/worker.php b/bin/worker.php index 18a41e064..42a8f533d 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -58,7 +58,7 @@ $dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config /** @var \Friendica\Core\Addon\Capabilities\ICanLoadAddons $addonLoader */ $addonLoader = $dice->create(\Friendica\Core\Addon\Capabilities\ICanLoadAddons::class); $dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies')); -$dice = $dice->addRule(LoggerInterface::class,['constructParams' => [LogChannel::WORKER]]); +$dice = $dice->addRule(LoggerInterface::class, ['constructParams' => [LogChannel::WORKER]]); DI::init($dice); \Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class)); diff --git a/src/Core/Addon/Exception/AddonInvalidConfigFileException.php b/src/Core/Addon/Exception/AddonInvalidConfigFileException.php index 3bb41be53..bf173d0a4 100644 --- a/src/Core/Addon/Exception/AddonInvalidConfigFileException.php +++ b/src/Core/Addon/Exception/AddonInvalidConfigFileException.php @@ -28,7 +28,7 @@ use Throwable; */ class AddonInvalidConfigFileException extends \RuntimeException { - public function __construct($message = "", $code = 0, Throwable $previous = null) + public function __construct($message = '', $code = 0, Throwable $previous = null) { parent::__construct($message, 500, $previous); } diff --git a/src/Core/Hooks/Exceptions/HookConfigException.php b/src/Core/Hooks/Exceptions/HookConfigException.php index ceca721b1..6588787eb 100644 --- a/src/Core/Hooks/Exceptions/HookConfigException.php +++ b/src/Core/Hooks/Exceptions/HookConfigException.php @@ -23,7 +23,7 @@ namespace Friendica\Core\Hooks\Exceptions; class HookConfigException extends \RuntimeException { - public function __construct($message = "", \Throwable $previous = null) + public function __construct($message = '', \Throwable $previous = null) { parent::__construct($message, 500, $previous); } diff --git a/src/Core/Logger/Exception/LogLevelException.php b/src/Core/Logger/Exception/LogLevelException.php index a79db80f5..9cf649a86 100644 --- a/src/Core/Logger/Exception/LogLevelException.php +++ b/src/Core/Logger/Exception/LogLevelException.php @@ -28,7 +28,7 @@ use Throwable; */ class LogLevelException extends \InvalidArgumentException { - public function __construct($message = "", Throwable $previous = null) + public function __construct($message = '', Throwable $previous = null) { parent::__construct($message, 500, $previous); } diff --git a/src/Core/Logger/Exception/LoggerArgumentException.php b/src/Core/Logger/Exception/LoggerArgumentException.php index bbc1fc066..6925be4c7 100644 --- a/src/Core/Logger/Exception/LoggerArgumentException.php +++ b/src/Core/Logger/Exception/LoggerArgumentException.php @@ -28,7 +28,7 @@ use Throwable; */ class LoggerArgumentException extends \InvalidArgumentException { - public function __construct($message = "", Throwable $previous = null) + public function __construct($message = '', Throwable $previous = null) { parent::__construct($message, 500, $previous); } diff --git a/src/Core/Logger/Exception/LoggerException.php b/src/Core/Logger/Exception/LoggerException.php index 742557678..7529f6e78 100644 --- a/src/Core/Logger/Exception/LoggerException.php +++ b/src/Core/Logger/Exception/LoggerException.php @@ -28,7 +28,7 @@ use Throwable; */ class LoggerException extends \Exception { - public function __construct($message = "", Throwable $previous = null) + public function __construct($message = '', Throwable $previous = null) { parent::__construct($message, 500, $previous); } diff --git a/src/Core/Logger/Exception/LoggerUnusableException.php b/src/Core/Logger/Exception/LoggerUnusableException.php index 46e49fd41..401a63482 100644 --- a/src/Core/Logger/Exception/LoggerUnusableException.php +++ b/src/Core/Logger/Exception/LoggerUnusableException.php @@ -28,7 +28,7 @@ use Throwable; */ class LoggerUnusableException extends \RuntimeException { - public function __construct($message = "", Throwable $previous = null) + public function __construct($message = '', Throwable $previous = null) { parent::__construct($message, 500, $previous); } diff --git a/src/Core/Logger/Factory/AbstractLoggerTypeFactory.php b/src/Core/Logger/Factory/AbstractLoggerTypeFactory.php index a6ff5eebb..402176d8e 100644 --- a/src/Core/Logger/Factory/AbstractLoggerTypeFactory.php +++ b/src/Core/Logger/Factory/AbstractLoggerTypeFactory.php @@ -69,7 +69,7 @@ abstract class AbstractLoggerTypeFactory return LogLevel::INFO; // legacy DATA case "4": - // legacy ALL + // legacy ALL case "5": return LogLevel::DEBUG; // default if nothing set