Fix foreign keys (#268) #1080
Annotations
10 warnings
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#L236
Escaped Mutant for Mutator "Minus":
--- Original
+++ New
@@ @@
return false;
}
if (!is_array(reset($with))) {
- usort($with, static fn(string $string1, string $string2) => mb_strlen($string2, 'UTF-8') - mb_strlen($string1, 'UTF-8'));
+ 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;
|
src/AbstractTokenizer.php#L285
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
if (!isset($this->substrings[$cacheKey . ',1'])) {
$this->substrings[$cacheKey . ',1'] = mb_substr($this->sql, $offset, $length, 'UTF-8');
}
- if (!$caseSensitive && !isset($this->substrings[$cacheKey . ',0'])) {
+ if (!$caseSensitive || !isset($this->substrings[$cacheKey . ',0'])) {
$this->substrings[$cacheKey . ',0'] = mb_strtoupper($this->substrings[$cacheKey . ',1'], 'UTF-8');
}
return $this->substrings[$cacheKey . ',' . (int) $caseSensitive];
|
src/AbstractTokenizer.php#L428
Escaped Mutant for Mutator "Ternary":
--- Original
+++ New
@@ @@
return;
}
$isKeyword = $this->isKeyword($this->buffer, $content);
- $this->currentToken[] = (new SqlToken())->type($isKeyword ? SqlToken::TYPE_KEYWORD : SqlToken::TYPE_TOKEN)->content(is_string($content) ? $content : $this->buffer)->startOffset($this->offset - mb_strlen($this->buffer, 'UTF-8'))->endOffset($this->offset);
+ $this->currentToken[] = (new SqlToken())->type($isKeyword ? SqlToken::TYPE_TOKEN : SqlToken::TYPE_KEYWORD)->content(is_string($content) ? $content : $this->buffer)->startOffset($this->offset - mb_strlen($this->buffer, 'UTF-8'))->endOffset($this->offset);
$this->buffer = '';
}
/**
|
src/AbstractTokenizer.php#L430
Escaped Mutant for Mutator "MBString":
--- Original
+++ New
@@ @@
return;
}
$isKeyword = $this->isKeyword($this->buffer, $content);
- $this->currentToken[] = (new SqlToken())->type($isKeyword ? SqlToken::TYPE_KEYWORD : SqlToken::TYPE_TOKEN)->content(is_string($content) ? $content : $this->buffer)->startOffset($this->offset - mb_strlen($this->buffer, 'UTF-8'))->endOffset($this->offset);
+ $this->currentToken[] = (new SqlToken())->type($isKeyword ? SqlToken::TYPE_KEYWORD : SqlToken::TYPE_TOKEN)->content(is_string($content) ? $content : $this->buffer)->startOffset($this->offset - strlen($this->buffer))->endOffset($this->offset);
$this->buffer = '';
}
/**
|
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}',
|
src/Column.php#L38
Escaped Mutant for Mutator "MatchArmRemoval":
--- Original
+++ New
@@ @@
$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}',
default => '{type}{length}{notnull}{unique}{check}{default}{append}',
};
|
src/Column.php#L38
Escaped Mutant for Mutator "MatchArmRemoval":
--- Original
+++ New
@@ @@
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}',
default => '{type}{length}{notnull}{unique}{check}{default}{append}',
};
return $this->buildCompleteString($format);
}
}
|
The logs for this run have expired and are no longer available.
Loading