Skip to content

Commit

Permalink
CS fix
Browse files Browse the repository at this point in the history
  • Loading branch information
s4ddly committed Dec 11, 2023
1 parent 4b2d6ab commit 0b0f411
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
14 changes: 6 additions & 8 deletions src/Utilities/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand All @@ -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);
Expand Down
8 changes: 6 additions & 2 deletions tests/LegacyNamespaceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class LegacyNamespaceTest extends TestCase
{
/**
* @dataProvider legacyClassNamesFromArray
*
* @param mixed $classNames
*/
public function testClassesExist($classNames)
{
Expand All @@ -25,6 +27,8 @@ class_exists($className) || interface_exists($className) || trait_exists($classN

/**
* @dataProvider legacyClassNamesFromArray
*
* @param mixed $classNames
*/
public function testClassesHaveUniqueNames($classNames)
{
Expand Down Expand Up @@ -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',
]
]
],
],
];
}
}

0 comments on commit 0b0f411

Please sign in to comment.