Skip to content

Commit 2383b1e

Browse files
committed
Fix unused function calls reported by Psalm
Introduced by bc47af8. Signed-off-by: Maurício Meneghini Fauth <[email protected]>
1 parent c3636a2 commit 2383b1e

File tree

6 files changed

+6
-23
lines changed

6 files changed

+6
-23
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,11 +1385,6 @@ parameters:
13851385
count: 1
13861386
path: src/Tools/ContextGenerator.php
13871387

1388-
-
1389-
message: "#^Call to function sprintf\\(\\) on a separate line has no effect\\.$#"
1390-
count: 1
1391-
path: src/Tools/ContextGenerator.php
1392-
13931388
-
13941389
message: "#^Method PhpMyAdmin\\\\SqlParser\\\\Tools\\\\ContextGenerator\\:\\:generate\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
13951390
count: 1
@@ -1435,11 +1430,6 @@ parameters:
14351430
count: 1
14361431
path: src/Tools/TestGenerator.php
14371432

1438-
-
1439-
message: "#^Call to function sprintf\\(\\) on a separate line has no effect\\.$#"
1440-
count: 2
1441-
path: src/Tools/TestGenerator.php
1442-
14431433
-
14441434
message: "#^Method PhpMyAdmin\\\\SqlParser\\\\Tools\\\\TestGenerator\\:\\:generate\\(\\) return type has no value type specified in iterable type array\\.$#"
14451435
count: 1

psalm-baseline.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="4.16.1@aa7e400908833b10c0333861f86cd48c510b60eb">
2+
<files psalm-version="4.17.0@6f4707aa41c9174353a6434bba3fc8840f981d9c">
33
<file src="src/Component.php">
44
<MixedReturnStatement occurrences="1">
55
<code>static::build($this)</code>
@@ -1243,9 +1243,6 @@
12431243
<code>++$i !== $count</code>
12441244
<code>++$i !== $count</code>
12451245
</RedundantCondition>
1246-
<UnusedFunctionCall occurrences="1">
1247-
<code>sprintf</code>
1248-
</UnusedFunctionCall>
12491246
</file>
12501247
<file src="src/Tools/TestGenerator.php">
12511248
<MixedOperand occurrences="1">
@@ -1255,10 +1252,6 @@
12551252
<code>$debugFile</code>
12561253
<code>$debugFile</code>
12571254
</PossiblyNullArgument>
1258-
<UnusedFunctionCall occurrences="2">
1259-
<code>sprintf</code>
1260-
<code>sprintf</code>
1261-
</UnusedFunctionCall>
12621255
</file>
12631256
<file src="src/Translator.php">
12641257
<DocblockTypeContradiction occurrences="1">

src/Tools/ContextGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public static function buildAll($input, $output)
396396
}
397397

398398
// Building the context.
399-
sprintf("Building context for %s...\n", $file);
399+
echo sprintf("Building context for %s...\n", $file);
400400
static::build($input . '/' . $file, $output);
401401
}
402402
}

src/Tools/TestGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public static function buildAll($input, $output, $debug = null)
243243

244244
// Building the test.
245245
if (! file_exists($outputFile)) {
246-
sprintf("Building test for %s...\n", $inputFile);
246+
echo sprintf("Building test for %s...\n", $inputFile);
247247
static::build(
248248
str_contains($inputFile, 'lex') ? 'lexer' : 'parser',
249249
$inputFile,
@@ -252,7 +252,7 @@ public static function buildAll($input, $output, $debug = null)
252252
str_contains($inputFile, 'ansi')
253253
);
254254
} else {
255-
sprintf("Test for %s already built!\n", $inputFile);
255+
echo sprintf("Test for %s already built!\n", $inputFile);
256256
}
257257
}
258258
}

tools/ContextGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use PhpMyAdmin\SqlParser\Tools\ContextGenerator;
66

7-
require_once __DIR__ . '/../vendor/autoload.php';
7+
require_once dirname(__DIR__) . '/vendor/autoload.php';
88

99
/**
1010
* Test generator.

tools/TestGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use PhpMyAdmin\SqlParser\Tools\TestGenerator;
66

7-
require_once '../vendor/autoload.php';
7+
require_once dirname(__DIR__) . '/vendor/autoload.php';
88

99
/**
1010
* Test generator.

0 commit comments

Comments
 (0)