Skip to content

Commit 273ddc4

Browse files
committed
Remove contract for parse method
Signed-off-by: Kamil Tekiela <[email protected]>
1 parent 2d23c71 commit 273ddc4

File tree

4 files changed

+42
-27
lines changed

4 files changed

+42
-27
lines changed

psalm-baseline.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
<MixedOperand>
6262
<code><![CDATA[$token->value]]></code>
6363
</MixedOperand>
64+
<UnusedParam>
65+
<code>$options</code>
66+
</UnusedParam>
6467
</file>
6568
<file src="src/Components/Condition.php">
6669
<MixedArrayOffset>
@@ -78,6 +81,9 @@
7881
<PossiblyNullOperand>
7982
<code><![CDATA[$this->options]]></code>
8083
</PossiblyNullOperand>
84+
<UnusedParam>
85+
<code>$options</code>
86+
</UnusedParam>
8187
</file>
8288
<file src="src/Components/DataType.php">
8389
<PossiblyInvalidPropertyFetch>
@@ -88,6 +94,9 @@
8894
<code>$name</code>
8995
<code>$options</code>
9096
</PossiblyNullPropertyAssignmentValue>
97+
<UnusedParam>
98+
<code>$options</code>
99+
</UnusedParam>
91100
</file>
92101
<file src="src/Components/Expression.php">
93102
<DocblockTypeContradiction>
@@ -145,6 +154,9 @@
145154
<code><![CDATA[$this->name]]></code>
146155
<code><![CDATA[$this->parameters]]></code>
147156
</PossiblyNullOperand>
157+
<UnusedParam>
158+
<code>$options</code>
159+
</UnusedParam>
148160
</file>
149161
<file src="src/Components/GroupKeyword.php">
150162
<PossiblyNullPropertyAssignmentValue>
@@ -154,6 +166,9 @@
154166
<PossiblyUnusedProperty>
155167
<code>$type</code>
156168
</PossiblyUnusedProperty>
169+
<UnusedParam>
170+
<code>$options</code>
171+
</UnusedParam>
157172
</file>
158173
<file src="src/Components/IndexHint.php">
159174
<MixedAssignment>
@@ -207,6 +222,9 @@
207222
<code>$using</code>
208223
<code><![CDATA[Expression::parse($parser, $list, ['field' => 'table'])]]></code>
209224
</PossiblyNullPropertyAssignmentValue>
225+
<UnusedParam>
226+
<code>$options</code>
227+
</UnusedParam>
210228
<UnusedVariable>
211229
<code>$state</code>
212230
<code>$state</code>
@@ -233,6 +251,9 @@
233251
<PropertyTypeCoercion>
234252
<code><![CDATA[$ret->columns]]></code>
235253
</PropertyTypeCoercion>
254+
<UnusedParam>
255+
<code>$options</code>
256+
</UnusedParam>
236257
</file>
237258
<file src="src/Components/Limit.php">
238259
<MixedAssignment>
@@ -248,6 +269,9 @@
248269
<PossiblyNullPropertyAssignmentValue>
249270
<code><![CDATA[Expression::parse($parser, $list, ['parseField' => 'table'])]]></code>
250271
</PossiblyNullPropertyAssignmentValue>
272+
<UnusedParam>
273+
<code>$options</code>
274+
</UnusedParam>
251275
</file>
252276
<file src="src/Components/OptionsArray.php">
253277
<MixedArgument>
@@ -336,6 +360,9 @@
336360
<code>$expr</code>
337361
<code>Expression::parse($parser, $list)</code>
338362
</PossiblyNullPropertyAssignmentValue>
363+
<UnusedParam>
364+
<code>$options</code>
365+
</UnusedParam>
339366
</file>
340367
<file src="src/Components/ParameterDefinition.php">
341368
<MixedAssignment>
@@ -350,6 +377,9 @@
350377
<RedundantConditionGivenDocblockType>
351378
<code><![CDATA[isset($expr->name)]]></code>
352379
</RedundantConditionGivenDocblockType>
380+
<UnusedParam>
381+
<code>$options</code>
382+
</UnusedParam>
353383
</file>
354384
<file src="src/Components/PartitionDefinition.php">
355385
<MissingConstructor>
@@ -384,6 +414,9 @@
384414
['type' => self::class],
385415
)]]></code>
386416
</PropertyTypeCoercion>
417+
<UnusedParam>
418+
<code>$options</code>
419+
</UnusedParam>
387420
<UnusedVariable>
388421
<code>$idx</code>
389422
</UnusedVariable>
@@ -404,6 +437,9 @@
404437
],
405438
)]]></code>
406439
</PossiblyNullPropertyAssignmentValue>
440+
<UnusedParam>
441+
<code>$options</code>
442+
</UnusedParam>
407443
</file>
408444
<file src="src/Components/RenameOperation.php">
409445
<PossiblyNullPropertyAssignmentValue>
@@ -426,6 +462,9 @@
426462
],
427463
)]]></code>
428464
</PossiblyNullPropertyAssignmentValue>
465+
<UnusedParam>
466+
<code>$options</code>
467+
</UnusedParam>
429468
</file>
430469
<file src="src/Components/SetOperation.php">
431470
<PossiblyNullPropertyAssignmentValue>
@@ -434,6 +473,9 @@
434473
<RedundantConditionGivenDocblockType>
435474
<code><![CDATA[$token->value === ',']]></code>
436475
</RedundantConditionGivenDocblockType>
476+
<UnusedParam>
477+
<code>$options</code>
478+
</UnusedParam>
437479
</file>
438480
<file src="src/Components/UnionKeyword.php">
439481
<PossiblyUnusedMethod>

src/Component.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@
1616
*/
1717
interface Component extends Stringable
1818
{
19-
/**
20-
* Parses the tokens contained in the given list in the context of the given parser.
21-
*
22-
* @param Parser $parser the parser that serves as context
23-
* @param TokensList $list the list of tokens that are being parsed
24-
* @param array<string, mixed> $options parameters for parsing
25-
*/
26-
public static function parse(Parser $parser, TokensList $list, array $options = []): mixed;
27-
2819
/**
2920
* Builds the string representation of a component of this type.
3021
*

src/Components/WithKeyword.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
use PhpMyAdmin\SqlParser\Component;
88
use PhpMyAdmin\SqlParser\Parser;
9-
use PhpMyAdmin\SqlParser\TokensList;
10-
use PhpMyAdmin\SqlParser\Translator;
119
use RuntimeException;
1210

1311
/**
@@ -29,20 +27,6 @@ public function __construct(string $name)
2927
$this->name = $name;
3028
}
3129

32-
/**
33-
* Parses the tokens contained in the given list in the context of the given parser.
34-
*
35-
* @param Parser $parser the parser that serves as context
36-
* @param TokensList $list the list of tokens that are being parsed
37-
* @param array<string, mixed> $options parameters for parsing
38-
*
39-
* @throws RuntimeException not implemented yet.
40-
*/
41-
public static function parse(Parser $parser, TokensList $list, array $options = []): mixed
42-
{
43-
throw new RuntimeException(Translator::gettext('Not implemented yet.'));
44-
}
45-
4630
public function build(): string
4731
{
4832
if (! isset($this->statement)) {

src/Statement.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,6 @@ public function parse(Parser $parser, TokensList $list): void
281281

282282
/**
283283
* The name of the class that is used for parsing.
284-
*
285-
* @var Component|null
286284
*/
287285
$class = null;
288286

0 commit comments

Comments
 (0)