Skip to content

Commit d607430

Browse files
committed
Merge branch '5.10.x'
Signed-off-by: Maurício Meneghini Fauth <[email protected]>
2 parents 3bc8d0d + 9fa8ca9 commit d607430

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+29808
-8336
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
- Move `Misc::getAliases()` into `SelectStatement::getAliases()` (#454)
77
- Drop `USE_UTF_STRINGS` constant (#471)
88

9+
## [5.9.1] - 2024-08-13
10+
11+
- Allow parsing ALTER TABLE statement with column check constraint (#554)
12+
- Add support for PHPUnit 10 (#573)
13+
914
## [5.9.0] - 2024-01-20
1015

1116
- Fix keywords not being recognized as table alias (#496)
@@ -567,3 +572,6 @@ __Breaking changes:__
567572
## [1.0.0] - 2015-08-20
568573

569574
* First release of this library.
575+
576+
[5.9.1]: https://github.com/phpmyadmin/sql-parser/compare/5.9.0...5.9.1
577+
[5.9.0]: https://github.com/phpmyadmin/sql-parser/compare/5.8.2...5.9.0

phpcs.xml.dist

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515

1616
<rule ref="PhpMyAdmin"/>
1717

18+
<rule ref="Generic.Files.LineLength.TooLong">
19+
<exclude-pattern>src/Contexts/*</exclude-pattern>
20+
</rule>
21+
1822
<rule ref="SlevomatCodingStandard.ControlStructures.RequireSingleLineCondition"/>
1923
<rule ref="SlevomatCodingStandard.Functions.RequireSingleLineCall"/>
2024
<rule ref="SlevomatCodingStandard.Whitespaces.DuplicateSpaces">

phpstan-baseline.neon

+25-5
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,11 @@ parameters:
400400
count: 1
401401
path: src/Statement.php
402402

403+
-
404+
message: "#^Access to an undefined property PhpMyAdmin\\\\SqlParser\\\\Statement\\:\\:\\$processListId\\.$#"
405+
count: 1
406+
path: src/Statement.php
407+
403408
-
404409
message: "#^Access to an undefined property PhpMyAdmin\\\\SqlParser\\\\Statement\\:\\:\\$renames\\.$#"
405410
count: 1
@@ -435,6 +440,16 @@ parameters:
435440
count: 1
436441
path: src/Statement.php
437442

443+
-
444+
message: "#^Access to undefined constant static\\(PhpMyAdmin\\\\SqlParser\\\\Statement\\)\\:\\:STATEMENT_END_OPTIONS\\.$#"
445+
count: 1
446+
path: src/Statement.php
447+
448+
-
449+
message: "#^Method PhpMyAdmin\\\\SqlParser\\\\Statement\\:\\:getClauseOrder\\(\\) should return array\\<string, int\\> but returns array\\<int\\|string, int\\>\\.$#"
450+
count: 1
451+
path: src/Statement.php
452+
438453
-
439454
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Statement\\:\\:\\$options \\(PhpMyAdmin\\\\SqlParser\\\\Components\\\\OptionsArray\\|null\\) does not accept array\\<PhpMyAdmin\\\\SqlParser\\\\Component\\>\\|PhpMyAdmin\\\\SqlParser\\\\Components\\\\ArrayObj\\|PhpMyAdmin\\\\SqlParser\\\\Components\\\\Expression\\|PhpMyAdmin\\\\SqlParser\\\\Components\\\\FunctionCall\\|PhpMyAdmin\\\\SqlParser\\\\Components\\\\IntoKeyword\\|PhpMyAdmin\\\\SqlParser\\\\Components\\\\Limit\\|PhpMyAdmin\\\\SqlParser\\\\Components\\\\OptionsArray\\|null\\.$#"
440455
count: 1
@@ -605,6 +620,11 @@ parameters:
605620
count: 1
606621
path: src/Statements/SelectStatement.php
607622

623+
-
624+
message: "#^Access to an undefined property PhpMyAdmin\\\\SqlParser\\\\Statements\\\\SelectStatement\\:\\:\\$processListId\\.$#"
625+
count: 1
626+
path: src/Statements/SelectStatement.php
627+
608628
-
609629
message: "#^Access to an undefined property PhpMyAdmin\\\\SqlParser\\\\Statements\\\\SelectStatement\\:\\:\\$renames\\.$#"
610630
count: 1
@@ -745,11 +765,6 @@ parameters:
745765
count: 1
746766
path: src/Tools/ContextGenerator.php
747767

748-
-
749-
message: "#^Offset 'keywords' on array\\{name\\: string, class\\: string, link\\: string, keywords\\: array\\<int, array\\<int, array\\<int, string\\>\\>\\>\\} in isset\\(\\) always exists and is not nullable\\.$#"
750-
count: 1
751-
path: src/Tools/ContextGenerator.php
752-
753768
-
754769
message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, array\\<int, string\\>\\|false given\\.$#"
755770
count: 1
@@ -930,3 +945,8 @@ parameters:
930945
count: 2
931946
path: src/Utils/Table.php
932947

948+
-
949+
message: "#^Parameter \\#2 \\$list of static method PhpMyAdmin\\\\SqlParser\\\\Utils\\\\Query\\:\\:replaceClause\\(\\) expects PhpMyAdmin\\\\SqlParser\\\\TokensList, PhpMyAdmin\\\\SqlParser\\\\TokensList\\|null given\\.$#"
950+
count: 1
951+
path: tests/Utils/QueryTest.php
952+

psalm-baseline.xml

+27-7
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,11 @@
292292
<code><![CDATA[ContextMySql80300]]></code>
293293
</UnusedClass>
294294
</file>
295+
<file src="src/Contexts/ContextMySql80400.php">
296+
<UnusedClass>
297+
<code><![CDATA[ContextMySql80400]]></code>
298+
</UnusedClass>
299+
</file>
295300
<file src="src/Lexer.php">
296301
<LoopInvalidation>
297302
<code><![CDATA[$this->last]]></code>
@@ -739,16 +744,25 @@
739744
<code><![CDATA[$this->$field]]></code>
740745
<code><![CDATA[$this->$field]]></code>
741746
<code><![CDATA[$this->$field]]></code>
747+
<code><![CDATA[static::STATEMENT_END_OPTIONS]]></code>
742748
</MixedArgument>
743749
<MixedMethodCall>
744750
<code><![CDATA[build]]></code>
745751
</MixedMethodCall>
746752
<MixedOperand>
747753
<code><![CDATA[$this->$field->build()]]></code>
748754
</MixedOperand>
755+
<MixedReturnTypeCoercion>
756+
<code><![CDATA[array<string, int>]]></code>
757+
<code><![CDATA[array_flip($clauses)]]></code>
758+
</MixedReturnTypeCoercion>
749759
<PossiblyUnusedReturnValue>
750760
<code><![CDATA[bool]]></code>
751761
</PossiblyUnusedReturnValue>
762+
<UndefinedConstant>
763+
<code><![CDATA[static::STATEMENT_END_OPTIONS]]></code>
764+
<code><![CDATA[static::STATEMENT_END_OPTIONS]]></code>
765+
</UndefinedConstant>
752766
<UndefinedMethod>
753767
<code><![CDATA[$class::buildAll($this->$field)]]></code>
754768
<code><![CDATA[$class::buildAll($this->$field)]]></code>
@@ -1052,13 +1066,11 @@
10521066
<InvalidArrayOffset>
10531067
<code><![CDATA[$version[count($version) - 1]]]></code>
10541068
</InvalidArrayOffset>
1055-
<PossiblyInvalidArgument>
1056-
<code><![CDATA[$options['keywords']]]></code>
1057-
</PossiblyInvalidArgument>
1058-
<RedundantCondition>
1059-
<code><![CDATA[++$i !== $count]]></code>
1060-
<code><![CDATA[++$i !== $count]]></code>
1061-
</RedundantCondition>
1069+
<MixedArgumentTypeCoercion>
1070+
<code><![CDATA[static function (int $num) use ($type): bool {
1071+
return ($type & $num) !== 0;
1072+
}]]></code>
1073+
</MixedArgumentTypeCoercion>
10621074
</file>
10631075
<file src="src/Tools/CustomJsonSerializer.php">
10641076
<MixedAssignment>
@@ -1492,6 +1504,11 @@
14921504
<code><![CDATA[insertProvider]]></code>
14931505
</PossiblyUnusedMethod>
14941506
</file>
1507+
<file src="tests/Parser/KillStatementTest.php">
1508+
<InvalidArgument>
1509+
<code><![CDATA[testBuildKill]]></code>
1510+
</InvalidArgument>
1511+
</file>
14951512
<file src="tests/Parser/LoadStatementTest.php">
14961513
<PossiblyUnusedMethod>
14971514
<code><![CDATA[loadProvider]]></code>
@@ -1593,6 +1610,9 @@
15931610
</PossiblyUnusedMethod>
15941611
</file>
15951612
<file src="tests/Utils/QueryTest.php">
1613+
<PossiblyNullArgument>
1614+
<code><![CDATA[$parser->list]]></code>
1615+
</PossiblyNullArgument>
15961616
<PossiblyUnusedMethod>
15971617
<code><![CDATA[getFlagsProvider]]></code>
15981618
<code><![CDATA[getTablesProvider]]></code>

0 commit comments

Comments
 (0)