Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -998,12 +998,10 @@
</PossiblyNullArgument>
</file>
<file src="src/Translator.php">
<DocblockTypeContradiction>
<code>self::$loader === null</code>
</DocblockTypeContradiction>
<RedundantConditionGivenDocblockType>
<code>self::$translator !== null</code>
</RedundantConditionGivenDocblockType>
<RedundantPropertyInitializationCheck>
<code>isset(self::$loader)</code>
<code>isset(self::$translator)</code>
</RedundantPropertyInitializationCheck>
</file>
<file src="src/UtfString.php">
<PossiblyUnusedProperty>
Expand Down
13 changes: 5 additions & 8 deletions src/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace PhpMyAdmin\SqlParser;

use PhpMyAdmin\MoTranslator\Loader;
use PhpMyAdmin\MoTranslator\Translator as MoTranslator;

use function class_exists;

Expand All @@ -15,24 +16,20 @@ class Translator
{
/**
* The MoTranslator loader object.
*
* @var Loader
*/
private static $loader;
private static Loader $loader;

/**
* The MoTranslator translator object.
*
* @var \PhpMyAdmin\MoTranslator\Translator
*/
private static $translator;
private static MoTranslator $translator;

/**
* Loads translator.
*/
public static function load(): void
{
if (self::$loader === null) {
if (! isset(self::$loader)) {
// Create loader object
self::$loader = new Loader();

Expand All @@ -48,7 +45,7 @@ public static function load(): void
self::$loader->bindtextdomain('sqlparser', __DIR__ . '/../locale/');
}

if (self::$translator !== null) {
if (isset(self::$translator)) {
return;
}

Expand Down