Skip to content

Remove some loose type checking #558

Remove some loose type checking

Remove some loose type checking #558

Triggered via pull request January 18, 2024 22:38
Status Success
Total duration 6m 32s
Artifacts

mutation-tests.yml

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

Annotations

11 warnings
Mutation tests with PHP 8.1: src/Components/Condition.php#L83
Escaped Mutant for Mutator "UnwrapTrim": --- Original +++ New @@ @@ /** @param string $expr the condition or the operator */ public function __construct(string|null $expr = null) { - $this->expr = trim((string) $expr); + $this->expr = (string) $expr; } /** * @param Parser $parser the parser that serves as context
Mutation tests with PHP 8.1: src/Components/Condition.php#L140
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ if (in_array($token->value, self::DELIMITERS, true)) { if ($betweenBefore && $token->value === 'AND') { // The syntax of keyword `BETWEEN` is hard-coded. - $betweenBefore = false; + $betweenBefore = true; } else { // The expression ended. $expr->expr = trim($expr->expr);
Mutation tests with PHP 8.1: src/Components/Expression.php#L176
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ /** * Whether a period was previously found. */ - $dot = false; + $dot = true; /** * Whether an alias is expected. Is 2 if `AS` keyword was found. */
Mutation tests with PHP 8.1: src/Components/Expression.php#L198
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ $prev = [null, null]; // When a field is parsed, no parentheses are expected. if (!empty($options['parseField'])) { - $options['breakOnParentheses'] = true; + $options['breakOnParentheses'] = false; $options['field'] = $options['parseField']; } for (; $list->idx < $list->count; ++$list->idx) {
Mutation tests with PHP 8.1: src/Components/Expression.php#L248
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ break; } if ($alias) { - $parser->error('An alias was expected.', $token); + break; } $alias = true;
Mutation tests with PHP 8.1: src/Components/Expression.php#L249
Escaped Mutant for Mutator "Break_": --- Original +++ New @@ @@ } if ($alias) { $parser->error('An alias was expected.', $token); - break; + continue; } $alias = true; continue;
Mutation tests with PHP 8.1: src/Components/Expression.php#L261
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ // 'SELECT a = CASE .... END, b=1, `id`, ... FROM ...' $tempCaseExpr = CaseExpression::parse($parser, $list); $ret->expr .= $tempCaseExpr->build(); - $isExpr = true; + $isExpr = false; continue; } $isExpr = true;
Mutation tests with PHP 8.1: src/Components/Expression.php#L262
Escaped Mutant for Mutator "Continue_": --- Original +++ New @@ @@ $tempCaseExpr = CaseExpression::parse($parser, $list); $ret->expr .= $tempCaseExpr->build(); $isExpr = true; - continue; + break; } $isExpr = true; } elseif ($brackets === 0 && strlen((string) $ret->expr) > 0 && !$alias) {
Mutation tests with PHP 8.1: src/Components/Expression.php#L294
Escaped Mutant for Mutator "Break_": --- Original +++ New @@ @@ } if ($token->type === TokenType::Operator) { if (!empty($options['breakOnParentheses']) && ($token->value === '(' || $token->value === ')')) { - // No brackets were expected. - break; + continue; } if ($token->value === '(') { ++$brackets;
Mutation tests with PHP 8.1: src/Components/Expression.php#L309
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ $ret->function = $prev[1]->value; } } elseif ($token->value === ')') { - if ($brackets === 0) { + if ($brackets === -1) { // Not our bracket 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/