Skip to content

Push Statement::parse() down to SelectStatement #589

Push Statement::parse() down to SelectStatement

Push Statement::parse() down to SelectStatement #589

Triggered via pull request May 23, 2024 12:04
Status Failure
Total duration 4m 47s
Artifacts

mutation-tests.yml

on: pull_request
Matrix: tests
Fit to window
Zoom out
Zoom in

Annotations

1 error and 12 warnings
Mutation tests with PHP 8.1
Process completed with exit code 1.
Mutation tests with PHP 8.1
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions/cache@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Mutation tests with PHP 8.1: src/Statement.php#L92
Escaped Mutant for Mutator "LogicalOr": --- Original +++ New @@ @@ */ public function __construct(Parser|null $parser = null, TokensList|null $list = null) { - if ($parser === null || $list === null) { + if ($parser === null && $list === null) { return; } $this->parse($parser, $list);
Mutation tests with PHP 8.1: src/Statement.php#L144
Escaped Mutant for Mutator "UnwrapTrim": --- Original +++ New @@ @@ } // Checking if the name of the clause should be added. if ($type & self::ADD_KEYWORD) { - $query = trim($query) . ' ' . $name; + $query = $query . ' ' . $name; } // Checking if the result of the builder should be added. if (!($type & self::ADD_CLAUSE)) {
Mutation tests with PHP 8.1: src/Statement.php#L156
Escaped Mutant for Mutator "UnwrapTrim": --- Original +++ New @@ @@ $class = Parser::KEYWORD_PARSERS[$name]['class']; $query = trim($query) . ' ' . $class::buildAll($this->{$field}); } else { - $query = trim($query) . ' ' . $this->{$field}->build(); + $query = $query . ' ' . $this->{$field}->build(); } } return $query;
Mutation tests with PHP 8.1: src/Statement.php#L171
Escaped Mutant for Mutator "PublicVisibility": --- Original +++ New @@ @@ * * @throws ParserException */ - public function parse(Parser $parser, TokensList $list): void + protected function parse(Parser $parser, TokensList $list): void { /** * Array containing all list of clauses parsed.
Mutation tests with PHP 8.1: src/Statement.php#L189
Escaped Mutant for Mutator "LessThan": --- Original +++ New @@ @@ * default. */ $parsedOptions = static::$statementOptions === []; - for (; $list->idx < $list->count; ++$list->idx) { + for (; $list->idx <= $list->count; ++$list->idx) { /** * Token parsed at this moment. */
Mutation tests with PHP 8.1: src/Statement.php#L202
Escaped Mutant for Mutator "Identical": --- Original +++ New @@ @@ } // Checking if this closing bracket is the pair for a bracket // outside the statement. - if ($token->value === ')' && $parser->brackets > 0) { + if ($token->value !== ')' && $parser->brackets > 0) { --$parser->brackets; continue; }
Mutation tests with PHP 8.1: src/Statement.php#L202
Escaped Mutant for Mutator "GreaterThan": --- Original +++ New @@ @@ } // Checking if this closing bracket is the pair for a bracket // outside the statement. - if ($token->value === ')' && $parser->brackets > 0) { + if ($token->value === ')' && $parser->brackets >= 0) { --$parser->brackets; continue; }
Mutation tests with PHP 8.1: src/Statement.php#L202
Escaped Mutant for Mutator "GreaterThanNegotiation": --- Original +++ New @@ @@ } // Checking if this closing bracket is the pair for a bracket // outside the statement. - if ($token->value === ')' && $parser->brackets > 0) { + if ($token->value === ')' && $parser->brackets <= 0) { --$parser->brackets; continue; }
Mutation tests with PHP 8.1: src/Statement.php#L202
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ } // Checking if this closing bracket is the pair for a bracket // outside the statement. - if ($token->value === ')' && $parser->brackets > 0) { + if ($token->value === ')' || $parser->brackets > 0) { --$parser->brackets; continue; }
Mutation tests with PHP 8.1: src/Statement.php#L220
Escaped Mutant for Mutator "LogicalOr": --- Original +++ New @@ @@ } // Unions are parsed by the parser because they represent more than // one statement. - if ($token->keyword === 'UNION' || $token->keyword === 'UNION ALL' || $token->keyword === 'UNION DISTINCT' || $token->keyword === 'EXCEPT' || $token->keyword === 'INTERSECT') { + if ($token->keyword === 'UNION' && $token->keyword === 'UNION ALL' || $token->keyword === 'UNION DISTINCT' || $token->keyword === 'EXCEPT' || $token->keyword === 'INTERSECT') { break; } /**
Mutation tests with PHP 8.1
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/