Skip to content

Commit

Permalink
Merge branch '5.10.x'
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <[email protected]>
  • Loading branch information
MauricioFauth committed Aug 25, 2024
2 parents 3bc8d0d + 9fa8ca9 commit d607430
Show file tree
Hide file tree
Showing 67 changed files with 29,808 additions and 8,336 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
- Move `Misc::getAliases()` into `SelectStatement::getAliases()` (#454)
- Drop `USE_UTF_STRINGS` constant (#471)

## [5.9.1] - 2024-08-13

- Allow parsing ALTER TABLE statement with column check constraint (#554)
- Add support for PHPUnit 10 (#573)

## [5.9.0] - 2024-01-20

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

* First release of this library.

[5.9.1]: https://github.com/phpmyadmin/sql-parser/compare/5.9.0...5.9.1
[5.9.0]: https://github.com/phpmyadmin/sql-parser/compare/5.8.2...5.9.0
4 changes: 4 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

<rule ref="PhpMyAdmin"/>

<rule ref="Generic.Files.LineLength.TooLong">
<exclude-pattern>src/Contexts/*</exclude-pattern>
</rule>

<rule ref="SlevomatCodingStandard.ControlStructures.RequireSingleLineCondition"/>
<rule ref="SlevomatCodingStandard.Functions.RequireSingleLineCall"/>
<rule ref="SlevomatCodingStandard.Whitespaces.DuplicateSpaces">
Expand Down
30 changes: 25 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,11 @@ parameters:
count: 1
path: src/Statement.php

-
message: "#^Access to an undefined property PhpMyAdmin\\\\SqlParser\\\\Statement\\:\\:\\$processListId\\.$#"
count: 1
path: src/Statement.php

-
message: "#^Access to an undefined property PhpMyAdmin\\\\SqlParser\\\\Statement\\:\\:\\$renames\\.$#"
count: 1
Expand Down Expand Up @@ -435,6 +440,16 @@ parameters:
count: 1
path: src/Statement.php

-
message: "#^Access to undefined constant static\\(PhpMyAdmin\\\\SqlParser\\\\Statement\\)\\:\\:STATEMENT_END_OPTIONS\\.$#"
count: 1
path: src/Statement.php

-
message: "#^Method PhpMyAdmin\\\\SqlParser\\\\Statement\\:\\:getClauseOrder\\(\\) should return array\\<string, int\\> but returns array\\<int\\|string, int\\>\\.$#"
count: 1
path: src/Statement.php

-
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\\.$#"
count: 1
Expand Down Expand Up @@ -605,6 +620,11 @@ parameters:
count: 1
path: src/Statements/SelectStatement.php

-
message: "#^Access to an undefined property PhpMyAdmin\\\\SqlParser\\\\Statements\\\\SelectStatement\\:\\:\\$processListId\\.$#"
count: 1
path: src/Statements/SelectStatement.php

-
message: "#^Access to an undefined property PhpMyAdmin\\\\SqlParser\\\\Statements\\\\SelectStatement\\:\\:\\$renames\\.$#"
count: 1
Expand Down Expand Up @@ -745,11 +765,6 @@ parameters:
count: 1
path: src/Tools/ContextGenerator.php

-
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\\.$#"
count: 1
path: src/Tools/ContextGenerator.php

-
message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, array\\<int, string\\>\\|false given\\.$#"
count: 1
Expand Down Expand Up @@ -930,3 +945,8 @@ parameters:
count: 2
path: src/Utils/Table.php

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

34 changes: 27 additions & 7 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@
<code><![CDATA[ContextMySql80300]]></code>
</UnusedClass>
</file>
<file src="src/Contexts/ContextMySql80400.php">
<UnusedClass>
<code><![CDATA[ContextMySql80400]]></code>
</UnusedClass>
</file>
<file src="src/Lexer.php">
<LoopInvalidation>
<code><![CDATA[$this->last]]></code>
Expand Down Expand Up @@ -739,16 +744,25 @@
<code><![CDATA[$this->$field]]></code>
<code><![CDATA[$this->$field]]></code>
<code><![CDATA[$this->$field]]></code>
<code><![CDATA[static::STATEMENT_END_OPTIONS]]></code>
</MixedArgument>
<MixedMethodCall>
<code><![CDATA[build]]></code>
</MixedMethodCall>
<MixedOperand>
<code><![CDATA[$this->$field->build()]]></code>
</MixedOperand>
<MixedReturnTypeCoercion>
<code><![CDATA[array<string, int>]]></code>
<code><![CDATA[array_flip($clauses)]]></code>
</MixedReturnTypeCoercion>
<PossiblyUnusedReturnValue>
<code><![CDATA[bool]]></code>
</PossiblyUnusedReturnValue>
<UndefinedConstant>
<code><![CDATA[static::STATEMENT_END_OPTIONS]]></code>
<code><![CDATA[static::STATEMENT_END_OPTIONS]]></code>
</UndefinedConstant>
<UndefinedMethod>
<code><![CDATA[$class::buildAll($this->$field)]]></code>
<code><![CDATA[$class::buildAll($this->$field)]]></code>
Expand Down Expand Up @@ -1052,13 +1066,11 @@
<InvalidArrayOffset>
<code><![CDATA[$version[count($version) - 1]]]></code>
</InvalidArrayOffset>
<PossiblyInvalidArgument>
<code><![CDATA[$options['keywords']]]></code>
</PossiblyInvalidArgument>
<RedundantCondition>
<code><![CDATA[++$i !== $count]]></code>
<code><![CDATA[++$i !== $count]]></code>
</RedundantCondition>
<MixedArgumentTypeCoercion>
<code><![CDATA[static function (int $num) use ($type): bool {
return ($type & $num) !== 0;
}]]></code>
</MixedArgumentTypeCoercion>
</file>
<file src="src/Tools/CustomJsonSerializer.php">
<MixedAssignment>
Expand Down Expand Up @@ -1492,6 +1504,11 @@
<code><![CDATA[insertProvider]]></code>
</PossiblyUnusedMethod>
</file>
<file src="tests/Parser/KillStatementTest.php">
<InvalidArgument>
<code><![CDATA[testBuildKill]]></code>
</InvalidArgument>
</file>
<file src="tests/Parser/LoadStatementTest.php">
<PossiblyUnusedMethod>
<code><![CDATA[loadProvider]]></code>
Expand Down Expand Up @@ -1593,6 +1610,9 @@
</PossiblyUnusedMethod>
</file>
<file src="tests/Utils/QueryTest.php">
<PossiblyNullArgument>
<code><![CDATA[$parser->list]]></code>
</PossiblyNullArgument>
<PossiblyUnusedMethod>
<code><![CDATA[getFlagsProvider]]></code>
<code><![CDATA[getTablesProvider]]></code>
Expand Down
Loading

0 comments on commit d607430

Please sign in to comment.