Skip to content

Commit f8b0b75

Browse files
committed
Fix ParameterDefinition::build
Signed-off-by: Kamil Tekiela <[email protected]>
1 parent d6e0d4c commit f8b0b75

File tree

3 files changed

+3
-29
lines changed

3 files changed

+3
-29
lines changed

phpstan-baseline.neon

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,6 @@ parameters:
335335
count: 2
336336
path: src/Components/OrderKeyword.php
337337

338-
-
339-
message: "#^Parameter \\#1 \\$component of static method PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\:\\:build\\(\\) expects array\\<PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\>, \\$this\\(PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\) given\\.$#"
340-
count: 1
341-
path: src/Components/ParameterDefinition.php
342-
343338
-
344339
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\:\\:\\$inOut \\(string\\) does not accept string\\|null\\.$#"
345340
count: 1
@@ -365,11 +360,6 @@ parameters:
365360
count: 2
366361
path: src/Components/ParameterDefinition.php
367362

368-
-
369-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
370-
count: 1
371-
path: src/Components/ParameterDefinition.php
372-
373363
-
374364
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Components\\\\PartitionDefinition\\:\\:\\$expr \\(PhpMyAdmin\\\\SqlParser\\\\Components\\\\Expression\\|string\\) does not accept PhpMyAdmin\\\\SqlParser\\\\Components\\\\Expression\\|null\\.$#"
375365
count: 1
@@ -596,7 +586,7 @@ parameters:
596586
path: src/Statements/CreateStatement.php
597587

598588
-
599-
message: "#^Parameter \\#1 \\$component of static method PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\:\\:build\\(\\) expects array\\<PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\>, array\\<PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\>\\|null given\\.$#"
589+
message: "#^Parameter \\#1 \\$component of static method PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\:\\:build\\(\\) expects array\\<PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\>\\|PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition, array\\<PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\>\\|null given\\.$#"
600590
count: 1
601591
path: src/Statements/CreateStatement.php
602592

@@ -961,7 +951,7 @@ parameters:
961951
path: tests/Builder/CreateStatementTest.php
962952

963953
-
964-
message: "#^Parameter \\#1 \\$component of static method PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\:\\:build\\(\\) expects array\\<PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\>, array\\<PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\>\\|null given\\.$#"
954+
message: "#^Parameter \\#1 \\$component of static method PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\:\\:build\\(\\) expects array\\<PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\>\\|PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition, array\\<PhpMyAdmin\\\\SqlParser\\\\Components\\\\ParameterDefinition\\>\\|null given\\.$#"
965955
count: 2
966956
path: tests/Builder/CreateStatementTest.php
967957

psalm-baseline.xml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -485,24 +485,9 @@
485485
</PossiblyNullPropertyAssignmentValue>
486486
</file>
487487
<file src="src/Components/ParameterDefinition.php">
488-
<InvalidArgument>
489-
<code>$this</code>
490-
</InvalidArgument>
491-
<MixedArgument>
492-
<code><![CDATA[$component->name]]></code>
493-
</MixedArgument>
494488
<MixedAssignment>
495489
<code><![CDATA[$expr->name]]></code>
496490
</MixedAssignment>
497-
<MixedOperand>
498-
<code><![CDATA[$component->inOut]]></code>
499-
<code><![CDATA[$component->type]]></code>
500-
</MixedOperand>
501-
<MixedPropertyFetch>
502-
<code><![CDATA[$component->inOut]]></code>
503-
<code><![CDATA[$component->name]]></code>
504-
<code><![CDATA[$component->type]]></code>
505-
</MixedPropertyFetch>
506491
<MoreSpecificImplementedParamType>
507492
<code>$component</code>
508493
</MoreSpecificImplementedParamType>
@@ -513,7 +498,6 @@
513498
<code>DataType::parse($parser, $list)</code>
514499
</PossiblyNullPropertyAssignmentValue>
515500
<RedundantConditionGivenDocblockType>
516-
<code>is_array($component)</code>
517501
<code><![CDATA[isset($expr->name)]]></code>
518502
</RedundantConditionGivenDocblockType>
519503
</file>

src/Components/ParameterDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
141141
}
142142

143143
/**
144-
* @param ParameterDefinition[] $component the component to be built
144+
* @param ParameterDefinition[]|ParameterDefinition $component the component to be built
145145
*/
146146
public static function build($component): string
147147
{

0 commit comments

Comments
 (0)