Skip to content

Commit 28d8b68

Browse files
committed
Add native property types in Translator
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
1 parent 94f2db2 commit 28d8b68

2 files changed

Lines changed: 9 additions & 14 deletions

File tree

psalm-baseline.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -998,12 +998,10 @@
998998
</PossiblyNullArgument>
999999
</file>
10001000
<file src="src/Translator.php">
1001-
<DocblockTypeContradiction>
1002-
<code>self::$loader === null</code>
1003-
</DocblockTypeContradiction>
1004-
<RedundantConditionGivenDocblockType>
1005-
<code>self::$translator !== null</code>
1006-
</RedundantConditionGivenDocblockType>
1001+
<RedundantPropertyInitializationCheck>
1002+
<code>isset(self::$loader)</code>
1003+
<code>isset(self::$translator)</code>
1004+
</RedundantPropertyInitializationCheck>
10071005
</file>
10081006
<file src="src/UtfString.php">
10091007
<PossiblyUnusedProperty>

src/Translator.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace PhpMyAdmin\SqlParser;
66

77
use PhpMyAdmin\MoTranslator\Loader;
8+
use PhpMyAdmin\MoTranslator\Translator as MoTranslator;
89

910
use function class_exists;
1011

@@ -15,24 +16,20 @@ class Translator
1516
{
1617
/**
1718
* The MoTranslator loader object.
18-
*
19-
* @var Loader
2019
*/
21-
private static $loader;
20+
private static Loader $loader;
2221

2322
/**
2423
* The MoTranslator translator object.
25-
*
26-
* @var \PhpMyAdmin\MoTranslator\Translator
2724
*/
28-
private static $translator;
25+
private static MoTranslator $translator;
2926

3027
/**
3128
* Loads translator.
3229
*/
3330
public static function load(): void
3431
{
35-
if (self::$loader === null) {
32+
if (! isset(self::$loader)) {
3633
// Create loader object
3734
self::$loader = new Loader();
3835

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

51-
if (self::$translator !== null) {
48+
if (isset(self::$translator)) {
5249
return;
5350
}
5451

0 commit comments

Comments
 (0)