Support json type #1085
Annotations
10 warnings
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();
|
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]);
}
|
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]);
|
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]);
|
src/AbstractTokenizer.php#L389
Escaped Mutant for Mutator "Ternary":
--- Original
+++ New
@@ @@
if ($this->currentToken instanceof SqlToken && !$this->currentToken->getHasChildren()) {
break;
}
- $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->tokenStack->pop();
$this->currentToken = $this->tokenStack->top();
$this->currentToken[] = (new SqlToken())->type(SqlToken::TYPE_STATEMENT);
|
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;
|
src/AbstractTokenizer.php#L408
Escaped Mutant for Mutator "Plus":
--- 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) ? $content : $this->substring($length))->startOffset($this->offset)->endOffset($this->offset - $length);
break;
}
return true;
|
src/AbstractTokenizer.php#L443
Escaped Mutant for Mutator "LessThanOrEqualTo":
--- Original
+++ New
@@ @@
*/
private function advance(int $length) : void
{
- if ($length <= 0) {
+ if ($length < 0) {
throw new InvalidArgumentException('Length must be greater than 0.');
}
$this->offset += $length;
|
src/AbstractTokenizer.php#L456
Escaped Mutant for Mutator "GreaterThanOrEqualTo":
--- Original
+++ New
@@ @@
*/
private function isEof() : bool
{
- return $this->offset >= $this->length;
+ return $this->offset > $this->length;
}
}
|
src/Column.php#L38
Escaped Mutant for Mutator "MatchArmRemoval":
--- Original
+++ New
@@ @@
public function asString() : string
{
$format = match ($this->getTypeCategory()) {
- self::TYPE_CATEGORY_PK => '{type}{check}{append}',
self::TYPE_CATEGORY_NUMERIC => '{type}{length}{unsigned}{notnull}{unique}{check}{default}{append}',
self::TYPE_CATEGORY_UUID => '{type}{notnull}{unique}{default}{check}{comment}{append}',
self::TYPE_CATEGORY_UUID_PK => '{type}{notnull}{default}{check}{comment}{append}',
|
The logs for this run have expired and are no longer available.
Loading