Skip to content

Commit

Permalink
Merge pull request #536 from MauricioFauth/invalid-var
Browse files Browse the repository at this point in the history
Remove invalid var annotations
  • Loading branch information
MauricioFauth authored Jan 16, 2024
2 parents 69db6d8 + 958fc0c commit e55fadf
Show file tree
Hide file tree
Showing 43 changed files with 359 additions and 230 deletions.
3 changes: 0 additions & 3 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
</rule>

<!-- Rules that should be followed, but are not required -->
<rule ref="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.InvalidFormat">
<severity>4</severity>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint">
<severity>4</severity>
</rule>
Expand Down
138 changes: 129 additions & 9 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ parameters:
path: src/Components/DataType.php

-
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Components\\\\Expression\\:\\:\\$alias \\(string\\|null\\) does not accept mixed\\.$#"
count: 3
message: "#^Comparison operation \"\\<\" between int\\<1, max\\> and 0 is always false\\.$#"
count: 1
path: src/Components/Expression.php

-
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Components\\\\Expression\\:\\:\\$subquery \\(string\\|null\\) does not accept mixed\\.$#"
count: 1
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Components\\\\Expression\\:\\:\\$alias \\(string\\|null\\) does not accept mixed\\.$#"
count: 3
path: src/Components/Expression.php

-
message: "#^Strict comparison using \\=\\=\\= between PhpMyAdmin\\\\SqlParser\\\\Token and null will always evaluate to false\\.$#"
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Components\\\\Expression\\:\\:\\$subquery \\(string\\|null\\) does not accept mixed\\.$#"
count: 1
path: src/Components/Expression.php

Expand Down Expand Up @@ -176,7 +176,7 @@ parameters:
path: src/Components/JoinKeyword.php

-
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Components\\\\Key\\:\\:\\$columns \\(array\\<array\\{name\\?\\: string, length\\?\\: int, order\\?\\: string\\}\\>\\) does not accept non\\-empty\\-array\\<array\\<string, mixed\\>\\>\\.$#"
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Components\\\\Key\\:\\:\\$columns \\(array\\<array\\{name\\?\\: string, length\\?\\: int, order\\?\\: string\\}\\>\\) does not accept non\\-empty\\-array\\<array\\<'length'\\|'name'\\|'order', mixed\\>\\>\\.$#"
count: 1
path: src/Components/Key.php

Expand Down Expand Up @@ -405,13 +405,18 @@ parameters:
count: 4
path: src/Parser.php

-
message: "#^Instantiated class not found\\.$#"
count: 1
path: src/Parser.php

-
message: "#^Parameter \\#2 \\$list of method PhpMyAdmin\\\\SqlParser\\\\Statement\\:\\:validateClauseOrder\\(\\) expects PhpMyAdmin\\\\SqlParser\\\\TokensList, PhpMyAdmin\\\\SqlParser\\\\TokensList\\|null given\\.$#"
count: 3
count: 2
path: src/Parser.php

-
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Statements\\\\SelectStatement\\:\\:\\$union \\(array\\<PhpMyAdmin\\\\SqlParser\\\\Statements\\\\SelectStatement\\>\\) does not accept array\\<array\\<int, bool\\|PhpMyAdmin\\\\SqlParser\\\\Statements\\\\SelectStatement\\|string\\>\\|PhpMyAdmin\\\\SqlParser\\\\Statements\\\\SelectStatement\\>\\.$#"
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Statements\\\\SelectStatement\\:\\:\\$union \\(array\\<PhpMyAdmin\\\\SqlParser\\\\Statements\\\\SelectStatement\\>\\) does not accept array\\<array\\<int, PhpMyAdmin\\\\SqlParser\\\\Statements\\\\SelectStatement\\|string\\>\\|PhpMyAdmin\\\\SqlParser\\\\Statements\\\\SelectStatement\\>\\.$#"
count: 1
path: src/Parser.php

Expand All @@ -421,7 +426,112 @@ parameters:
path: src/Parser.php

-
message: "#^Call to an undefined static method PhpMyAdmin\\\\SqlParser\\\\Component\\:\\:buildAll\\(\\)\\.$#"
message: "#^Access to an undefined property PhpMyAdmin\\\\SqlParser\\\\Statement\\:\\:\\$call\\.$#"
count: 1
path: src/Statement.php

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Expand All @@ -435,6 +545,11 @@ parameters:
count: 1
path: src/Statement.php

-
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Statement\\:\\:\\$options \\(PhpMyAdmin\\\\SqlParser\\\\Components\\\\OptionsArray\\|null\\) does not accept mixed\\.$#"
count: 1
path: src/Statement.php

-
message: "#^Argument of an invalid type array\\<PhpMyAdmin\\\\SqlParser\\\\Components\\\\AlterOperation\\>\\|null supplied for foreach, only iterables are supported\\.$#"
count: 1
Expand Down Expand Up @@ -570,6 +685,11 @@ parameters:
count: 1
path: src/Statements/LoadStatement.php

-
message: "#^Comparison operation \"\\>\\=\" between int\\<3, max\\> and 3 is always true\\.$#"
count: 1
path: src/Statements/LoadStatement.php

-
message: "#^Parameter \\#3 \\$keyword of method PhpMyAdmin\\\\SqlParser\\\\Statements\\\\LoadStatement\\:\\:parseFileOptions\\(\\) expects string, mixed given\\.$#"
count: 1
Expand Down
Loading

2 comments on commit e55fadf

@Ocramius
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not important, but wanted to bring up that type inference significantly worsened here: https://shepherd.dev/github/phpmyadmin/sql-parser

@MauricioFauth
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not important, but wanted to bring up that type inference significantly worsened here: https://shepherd.dev/github/phpmyadmin/sql-parser

Thank you, @Ocramius. I fixed the main culprit in b16987a. It's related to the Psalm issue vimeo/psalm#10063.

Please sign in to comment.