Escape identifiers that need it #455
Annotations
11 warnings
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:
src/Context.php#L580
Escaped Mutant for Mutator "GreaterThan":
--- Original
+++ New
@@ @@
if (!is_numeric($part)) {
break 2;
}
- } while (intval($part) === 0 && $i > 0);
+ } while (intval($part) === 0 && $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:
src/Context.php#L580
Escaped Mutant for Mutator "GreaterThanNegotiation":
--- Original
+++ New
@@ @@
if (!is_numeric($part)) {
break 2;
}
- } while (intval($part) === 0 && $i > 0);
+ } while (intval($part) === 0 && $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:
src/Context.php#L580
Escaped Mutant for Mutator "LogicalAndAllSubExprNegation":
--- Original
+++ New
@@ @@
if (!is_numeric($part)) {
break 2;
}
- } while (intval($part) === 0 && $i > 0);
+ } while (!(intval($part) === 0) && !($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/
|