diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index ac66aea14..2b448e944 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1055,11 +1055,6 @@ parameters: count: 1 path: tests/Parser/SelectStatementTest.php - - - message: "#^Parameter \\#1 \\$component of static method PhpMyAdmin\\\\SqlParser\\\\Components\\\\WithKeyword\\:\\:build\\(\\) expects PhpMyAdmin\\\\SqlParser\\\\Components\\\\WithKeyword, stdClass given\\.$#" - count: 1 - path: tests/Parser/WithStatementTest.php - - message: "#^Parameter \\#2 \\$list of static method PhpMyAdmin\\\\SqlParser\\\\Utils\\\\Query\\:\\:getClause\\(\\) expects PhpMyAdmin\\\\SqlParser\\\\TokensList, PhpMyAdmin\\\\SqlParser\\\\TokensList\\|null given\\.$#" count: 9 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 7bf34d4d0..7639a0070 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1641,11 +1641,6 @@ has - - - new stdClass() - - $data diff --git a/src/Components/WithKeyword.php b/src/Components/WithKeyword.php index 6cd7cb0c3..c7277f66b 100644 --- a/src/Components/WithKeyword.php +++ b/src/Components/WithKeyword.php @@ -51,10 +51,6 @@ public static function parse(Parser $parser, TokensList $list, array $options = */ public static function build($component, array $options = []): string { - if (! $component instanceof WithKeyword) { - throw new RuntimeException('Can not build a component that is not a WithKeyword'); - } - if (! isset($component->statement)) { throw new RuntimeException('No statement inside WITH'); } diff --git a/tests/Parser/WithStatementTest.php b/tests/Parser/WithStatementTest.php index 6e2ac18bf..7356be37e 100644 --- a/tests/Parser/WithStatementTest.php +++ b/tests/Parser/WithStatementTest.php @@ -8,7 +8,6 @@ use PhpMyAdmin\SqlParser\Lexer; use PhpMyAdmin\SqlParser\Parser; use PhpMyAdmin\SqlParser\Tests\TestCase; -use stdClass; class WithStatementTest extends TestCase { @@ -134,12 +133,6 @@ public function testWithHasUnclosedParenthesis(): void $this->assertEquals($parserErrors[0][0], 'A closing bracket was expected.'); } - public function testBuildWrongWithKeyword(): void - { - $this->expectExceptionMessage('Can not build a component that is not a WithKeyword'); - WithKeyword::build(new stdClass()); - } - public function testBuildBadWithKeyword(): void { $this->expectExceptionMessage('No statement inside WITH');