Add basic details for Condition #579
Annotations
9 warnings
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/Components/Condition.php#L37
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;
}
public function build() : string
{
|
Mutation tests with PHP 8.1:
src/Parsers/Conditions.php#L90
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
*/
$betweenBefore = false;
$hasSubQuery = false;
- $subQueryBracket = 0;
+ $subQueryBracket = -1;
for (; $list->idx < $list->count; ++$list->idx) {
/**
* Token parsed at this moment.
|
Mutation tests with PHP 8.1:
src/Parsers/Conditions.php#L122
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
}
continue;
}
- if (!$hasSubQuery && $token->keyword !== null && $token->type === TokenType::Keyword && $brackets > 0 && (Parser::STATEMENT_PARSERS[$token->keyword] ?? '') !== '') {
+ if ((!$hasSubQuery || $token->keyword !== null) && $token->type === TokenType::Keyword && $brackets > 0 && (Parser::STATEMENT_PARSERS[$token->keyword] ?? '') !== '') {
$hasSubQuery = true;
$subQueryBracket = $brackets;
}
|
Mutation tests with PHP 8.1:
src/Parsers/Conditions.php#L122
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
}
continue;
}
- if (!$hasSubQuery && $token->keyword !== null && $token->type === TokenType::Keyword && $brackets > 0 && (Parser::STATEMENT_PARSERS[$token->keyword] ?? '') !== '') {
+ if ((!$hasSubQuery && $token->keyword !== null || $token->type === TokenType::Keyword) && $brackets > 0 && (Parser::STATEMENT_PARSERS[$token->keyword] ?? '') !== '') {
$hasSubQuery = true;
$subQueryBracket = $brackets;
}
|
Mutation tests with PHP 8.1:
src/Parsers/Conditions.php#L122
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
}
continue;
}
- if (!$hasSubQuery && $token->keyword !== null && $token->type === TokenType::Keyword && $brackets > 0 && (Parser::STATEMENT_PARSERS[$token->keyword] ?? '') !== '') {
+ if ((!$hasSubQuery && $token->keyword !== null && $token->type === TokenType::Keyword || $brackets > 0) && (Parser::STATEMENT_PARSERS[$token->keyword] ?? '') !== '') {
$hasSubQuery = true;
$subQueryBracket = $brackets;
}
|
Mutation tests with PHP 8.1:
src/Parsers/Conditions.php#L124
Escaped Mutant for Mutator "GreaterThan":
--- Original
+++ New
@@ @@
}
continue;
}
- if (!$hasSubQuery && $token->keyword !== null && $token->type === TokenType::Keyword && $brackets > 0 && (Parser::STATEMENT_PARSERS[$token->keyword] ?? '') !== '') {
+ if (!$hasSubQuery && $token->keyword !== null && $token->type === TokenType::Keyword && $brackets >= 0 && (Parser::STATEMENT_PARSERS[$token->keyword] ?? '') !== '') {
$hasSubQuery = true;
$subQueryBracket = $brackets;
}
|
Mutation tests with PHP 8.1:
src/Parsers/Conditions.php#L135
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
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/
|