Minor fixes #516
Annotations
11 warnings
Mutation tests with PHP 8.1:
src/Components/GroupKeyword.php#L65
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
* @var int
*/
$state = 0;
- 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/Components/GroupKeyword.php#L77
Escaped Mutant for Mutator "LogicalOr":
--- Original
+++ New
@@ @@
break;
}
// Skipping whitespaces and comments.
- if ($token->type === TokenType::Whitespace || $token->type === TokenType::Comment) {
+ if ($token->type === TokenType::Whitespace && $token->type === TokenType::Comment) {
continue;
}
if ($state === 0) {
|
Mutation tests with PHP 8.1:
src/Components/GroupKeyword.php#L90
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
} elseif ($state === 1) {
if ($token->type === TokenType::Keyword && ($token->keyword === 'ASC' || $token->keyword === 'DESC')) {
$expr->type = $token->keyword;
- } elseif ($token->type === TokenType::Operator && $token->value === ',') {
+ } elseif ($token->type === TokenType::Operator || $token->value === ',') {
if (!empty($expr->expr)) {
$ret[] = $expr;
}
|
Mutation tests with PHP 8.1:
src/Context.php#L513
Escaped Mutant for Mutator "LessThanOrEqualTo":
--- Original
+++ New
@@ @@
{
// NOTES: Only non-alphanumeric ASCII characters may be separators.
// `~` is the last printable ASCII character.
- return $string <= '~' && $string !== '_' && $string !== '$' && ($string < '0' || $string > '9') && ($string < 'a' || $string > 'z') && ($string < 'A' || $string > 'Z');
+ return $string < '~' && $string !== '_' && $string !== '$' && ($string < '0' || $string > '9') && ($string < 'a' || $string > 'z') && ($string < 'A' || $string > 'Z');
}
/**
* Loads the specified context.
|
Mutation tests with PHP 8.1:
src/Context.php#L566
Escaped Mutant for Mutator "GreaterThan":
--- Original
+++ New
@@ @@
public static function loadClosest(string $context = '') : string|null
{
$length = strlen($context);
- for ($i = $length; $i > 0;) {
+ for ($i = $length; $i >= 0;) {
/* Trying to load the new context */
if (static::load($context)) {
return $context;
|
Mutation tests with PHP 8.1:
src/Context.php#L573
Escaped Mutant for Mutator "DoWhile":
--- Original
+++ New
@@ @@
if (!is_numeric($part)) {
break 2;
}
- } while (intval($part) === 0 && $i > 0);
+ } while (false);
$context = substr($context, 0, $i) . '00' . substr($context, $i + 2);
}
/* Fallback to loading at least matching engine */
|
Mutation tests with PHP 8.1:
src/Context.php#L574
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
}
/* Replace last two non zero digits by zeroes */
do {
- $i -= 2;
+ $i -= 1;
$part = substr($context, $i, 2);
/* No more numeric parts to strip */
if (!is_numeric($part)) {
|
Mutation tests with PHP 8.1:
src/Context.php#L575
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
/* Replace last two non zero digits by zeroes */
do {
$i -= 2;
- $part = substr($context, $i, 2);
+ $part = substr($context, $i, 1);
/* No more numeric parts to strip */
if (!is_numeric($part)) {
break 2;
|
Mutation tests with PHP 8.1:
src/Context.php#L575
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
/* Replace last two non zero digits by zeroes */
do {
$i -= 2;
- $part = substr($context, $i, 2);
+ $part = substr($context, $i, 3);
/* No more numeric parts to strip */
if (!is_numeric($part)) {
break 2;
|
Mutation tests with PHP 8.1:
src/Context.php#L580
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
if (!is_numeric($part)) {
break 2;
}
- } while (intval($part) === 0 && $i > 0);
+ } while (intval($part) === -1 && $i > 0);
$context = substr($context, 0, $i) . '00' . substr($context, $i + 2);
}
/* Fallback to loading at least matching engine */
|
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/
|