Remove nullability from IndexHint #648
Annotations
5 warnings
Get Composer cache directory
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/
|
Infection:
src/Parsers/IndexHints.php#L31
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
{
$ret = [];
$expr = new IndexHint();
- $expr->type = $options['type'] ?? '';
+ $expr->type = '' ?? $options['type'];
/**
* The state of the parser.
*
|
Infection:
src/Parsers/IndexHints.php#L47
Escaped Mutant for Mutator "GreaterThan":
--- Original
+++ New
@@ @@
$state = 0;
// By design, the parser will parse first token after the keyword. So, the keyword
// must be analyzed too, in order to determine the type of this index hint.
- if ($list->idx > 0) {
+ if ($list->idx >= 0) {
--$list->idx;
}
for (; $list->idx < $list->count; ++$list->idx) {
|
Infection:
src/Parsers/IndexHints.php#L51
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
if ($list->idx > 0) {
--$list->idx;
}
- for (; $list->idx < $list->count; ++$list->idx) {
+ for (; $list->idx <= $list->count; ++$list->idx) {
/**
* Token parsed at this moment.
*/
|
Infection:
src/Parsers/IndexHints.php#L95
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
}
break;
case 2:
- if ($token->type === TokenType::Keyword && $token->keyword === 'FOR') {
+ if ($token->type === TokenType::Keyword || $token->keyword === 'FOR') {
$state = 3;
} else {
$expr->indexes = ExpressionArray::parse($parser, $list);
|
Loading