From 0b0f4114a0373d713ca4054d119247524a1416f8 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 11 Dec 2023 14:47:17 +0100 Subject: [PATCH] CS fix --- src/Utilities/Logger.php | 14 ++++++-------- tests/LegacyNamespaceTest.php | 8 ++++++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Utilities/Logger.php b/src/Utilities/Logger.php index 8f708ca..b41c719 100644 --- a/src/Utilities/Logger.php +++ b/src/Utilities/Logger.php @@ -10,15 +10,13 @@ class Logger /** @var LoggerInterface */ private static $logger; - /** @var string|null */ - private static $customLogPath = null; + /** @var null|string */ + private static $customLogPath; - /** - * @throws TException - */ + /** @throws TException */ public static function enableLogging() { - if (get_class(self::$logger) !== NullLogger::class) { + if (NullLogger::class !== get_class(self::$logger)) { throw new TException('Logging is already enabled'); } @@ -37,14 +35,14 @@ public static function disableLogging() */ public static function setLogger($logger) { - if (get_class($logger) !== LoggerInterface::class) { + if (LoggerInterface::class !== get_class($logger)) { throw new TException(sprintf('%s is not instance of LoggerInterface', get_class($logger))); } self::$logger = $logger; } - /** @param string|null $logPath */ + /** @param null|string $logPath */ public static function setLogPath($logPath = null) { self::$logger = new FileLogger($logPath); diff --git a/tests/LegacyNamespaceTest.php b/tests/LegacyNamespaceTest.php index 1edf5c4..57b01ed 100644 --- a/tests/LegacyNamespaceTest.php +++ b/tests/LegacyNamespaceTest.php @@ -12,6 +12,8 @@ class LegacyNamespaceTest extends TestCase { /** * @dataProvider legacyClassNamesFromArray + * + * @param mixed $classNames */ public function testClassesExist($classNames) { @@ -25,6 +27,8 @@ class_exists($className) || interface_exists($className) || trait_exists($classN /** * @dataProvider legacyClassNamesFromArray + * + * @param mixed $classNames */ public function testClassesHaveUniqueNames($classNames) { @@ -108,8 +112,8 @@ public function legacyClassNamesFromArray() 'tpayLibs\\src\\_class_tpay\\Validators\\VariableTypes\\IntType', 'tpayLibs\\src\\_class_tpay\\Validators\\VariableTypes\\StringType', 'tpayLibs\\src\\_class_tpay\\Validators\\VariableTypes\\VariableTypesValidator', - ] - ] + ], + ], ]; } }