Refactor DMLQueryBuilder #1098
Annotations
10 warnings
Run infection.:
src/AbstractTokenizer.php#L106
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
$this->tokenStack->push($token[0]);
/** @psalm-var SqlToken */
$this->currentToken = $this->tokenStack->top();
- $length = 0;
+ $length = -1;
while (!$this->isEof()) {
if ($this->isWhitespace($length) || $this->isComment($length)) {
$this->addTokenFromBuffer();
|
Run infection.:
src/AbstractTokenizer.php#L127
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
$this->buffer .= $this->substring(1);
$this->advance(1);
}
- $this->addTokenFromBuffer();
+
if ($token->getHasChildren() && $token[-1] instanceof SqlToken && !$token[-1]->getHasChildren()) {
unset($token[-1]);
}
|
Run infection.:
src/AbstractTokenizer.php#L241
Escaped Mutant for Mutator "Ternary":
--- Original
+++ New
@@ @@
usort($with, static fn(string $string1, string $string2) => mb_strlen($string2, 'UTF-8') - mb_strlen($string1, 'UTF-8'));
$map = [];
foreach ($with as $string) {
- $map[mb_strlen($string, 'UTF-8')][$caseSensitive ? $string : mb_strtoupper($string, 'UTF-8')] = true;
+ $map[mb_strlen($string, 'UTF-8')][$caseSensitive ? mb_strtoupper($string, 'UTF-8') : $string] = true;
}
$with = $map;
}
|
Run infection.:
src/AbstractTokenizer.php#L333
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
if (!$isIdentifier && !$isStringLiteral) {
return false;
}
- $this->addTokenFromBuffer();
+
$this->currentToken[] = (new SqlToken())->type($isIdentifier ? SqlToken::TYPE_IDENTIFIER : SqlToken::TYPE_STRING_LITERAL)->content(is_string($content) ? $content : $this->substring($length))->startOffset($this->offset)->endOffset($this->offset + $length);
return true;
}
|
Run infection.:
src/AbstractTokenizer.php#L336
Escaped Mutant for Mutator "Ternary":
--- Original
+++ New
@@ @@
return false;
}
$this->addTokenFromBuffer();
- $this->currentToken[] = (new SqlToken())->type($isIdentifier ? SqlToken::TYPE_IDENTIFIER : SqlToken::TYPE_STRING_LITERAL)->content(is_string($content) ? $content : $this->substring($length))->startOffset($this->offset)->endOffset($this->offset + $length);
+ $this->currentToken[] = (new SqlToken())->type($isIdentifier ? SqlToken::TYPE_STRING_LITERAL : SqlToken::TYPE_IDENTIFIER)->content(is_string($content) ? $content : $this->substring($length))->startOffset($this->offset)->endOffset($this->offset + $length);
return true;
}
/**
|
Run infection.:
src/AbstractTokenizer.php#L337
Escaped Mutant for Mutator "Ternary":
--- Original
+++ New
@@ @@
return false;
}
$this->addTokenFromBuffer();
- $this->currentToken[] = (new SqlToken())->type($isIdentifier ? SqlToken::TYPE_IDENTIFIER : SqlToken::TYPE_STRING_LITERAL)->content(is_string($content) ? $content : $this->substring($length))->startOffset($this->offset)->endOffset($this->offset + $length);
+ $this->currentToken[] = (new SqlToken())->type($isIdentifier ? SqlToken::TYPE_IDENTIFIER : SqlToken::TYPE_STRING_LITERAL)->content(is_string($content) ? $this->substring($length) : $content)->startOffset($this->offset)->endOffset($this->offset + $length);
return true;
}
/**
|
Run infection.:
src/AbstractTokenizer.php#L341
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
}
$this->addTokenFromBuffer();
$this->currentToken[] = (new SqlToken())->type($isIdentifier ? SqlToken::TYPE_IDENTIFIER : SqlToken::TYPE_STRING_LITERAL)->content(is_string($content) ? $content : $this->substring($length))->startOffset($this->offset)->endOffset($this->offset + $length);
- return true;
+ return false;
}
/**
* Determines whether there is an operator at the current offset and adds it to the token children.
|
Run infection.:
src/AbstractTokenizer.php#L359
Escaped Mutant for Mutator "Ternary":
--- Original
+++ New
@@ @@
$this->addTokenFromBuffer();
switch ($this->substring($length)) {
case '(':
- $this->currentToken[] = (new SqlToken())->type(SqlToken::TYPE_OPERATOR)->content(is_string($content) ? $content : $this->substring($length))->startOffset($this->offset)->endOffset($this->offset + $length);
+ $this->currentToken[] = (new SqlToken())->type(SqlToken::TYPE_OPERATOR)->content(is_string($content) ? $this->substring($length) : $content)->startOffset($this->offset)->endOffset($this->offset + $length);
$this->currentToken[] = (new SqlToken())->type(SqlToken::TYPE_PARENTHESIS);
if ($this->currentToken[-1] !== null) {
$this->tokenStack->push($this->currentToken[-1]);
|
Run infection.:
src/AbstractTokenizer.php#L361
Escaped Mutant for Mutator "Plus":
--- Original
+++ New
@@ @@
$this->addTokenFromBuffer();
switch ($this->substring($length)) {
case '(':
- $this->currentToken[] = (new SqlToken())->type(SqlToken::TYPE_OPERATOR)->content(is_string($content) ? $content : $this->substring($length))->startOffset($this->offset)->endOffset($this->offset + $length);
+ $this->currentToken[] = (new SqlToken())->type(SqlToken::TYPE_OPERATOR)->content(is_string($content) ? $content : $this->substring($length))->startOffset($this->offset)->endOffset($this->offset - $length);
$this->currentToken[] = (new SqlToken())->type(SqlToken::TYPE_PARENTHESIS);
if ($this->currentToken[-1] !== null) {
$this->tokenStack->push($this->currentToken[-1]);
|
Run infection.:
src/AbstractTokenizer.php#L406
Escaped Mutant for Mutator "Ternary":
--- Original
+++ New
@@ @@
$this->currentToken = $this->tokenStack->top();
break;
default:
- $this->currentToken[] = (new SqlToken())->type(SqlToken::TYPE_OPERATOR)->content(is_string($content) ? $content : $this->substring($length))->startOffset($this->offset)->endOffset($this->offset + $length);
+ $this->currentToken[] = (new SqlToken())->type(SqlToken::TYPE_OPERATOR)->content(is_string($content) ? $this->substring($length) : $content)->startOffset($this->offset)->endOffset($this->offset + $length);
break;
}
return true;
|
The logs for this run have expired and are no longer available.
Loading