Refactor getForeignKeys() #616
Triggered via pull request
September 21, 2024 19:03
Status
Success
Total duration
1m 49s
Artifacts
–
Annotations
12 warnings
Mutation tests with PHP 8.2
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions/cache@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Mutation tests with PHP 8.2
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/
|
Mutation tests with PHP 8.2:
src/Statements/CreateStatement.php#L430
Escaped Mutant for Mutator "Assignment":
--- Original
+++ New
@@ @@
}
$partition = '';
if (!empty($this->partitionBy)) {
- $partition .= "\nPARTITION BY " . $this->partitionBy;
+ $partition = "\nPARTITION BY " . $this->partitionBy;
}
if (!empty($this->partitionsNum)) {
$partition .= "\nPARTITIONS " . $this->partitionsNum;
|
Mutation tests with PHP 8.2:
src/Statements/CreateStatement.php#L465
Escaped Mutant for Mutator "Concat":
--- Original
+++ New
@@ @@
} elseif ($this->with !== null) {
$builtStatement = $this->with->build();
}
- return 'CREATE ' . $this->options->build() . ' ' . $this->name->build() . ' ' . $fields . ' AS ' . $builtStatement . TokensList::buildFromArray($this->body) . ' ' . ($this->entityOptions?->build() ?? '');
+ return 'CREATE ' . $this->options->build() . ' ' . $this->name->build() . ' ' . $fields . ' AS ' . $builtStatement . TokensList::buildFromArray($this->body) . ($this->entityOptions?->build() ?? '') . ' ';
}
if ($this->options->has('TRIGGER')) {
return 'CREATE ' . $this->options->build() . ' ' . $this->name->build() . ' ' . $this->entityOptions->build() . ' ' . 'ON ' . $this->table->build() . ' ' . 'FOR EACH ROW ' . TokensList::buildFromArray($this->body);
|
Mutation tests with PHP 8.2:
src/Statements/CreateStatement.php#L465
Escaped Mutant for Mutator "ConcatOperandRemoval":
--- Original
+++ New
@@ @@
} elseif ($this->with !== null) {
$builtStatement = $this->with->build();
}
- return 'CREATE ' . $this->options->build() . ' ' . $this->name->build() . ' ' . $fields . ' AS ' . $builtStatement . TokensList::buildFromArray($this->body) . ' ' . ($this->entityOptions?->build() ?? '');
+ return 'CREATE ' . $this->options->build() . ' ' . $this->name->build() . ' ' . $fields . ' AS ' . $builtStatement . TokensList::buildFromArray($this->body) . ' ';
}
if ($this->options->has('TRIGGER')) {
return 'CREATE ' . $this->options->build() . ' ' . $this->name->build() . ' ' . $this->entityOptions->build() . ' ' . 'ON ' . $this->table->build() . ' ' . 'FOR EACH ROW ' . TokensList::buildFromArray($this->body);
|
Mutation tests with PHP 8.2:
src/Statements/CreateStatement.php#L470
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
} elseif ($this->with !== null) {
$builtStatement = $this->with->build();
}
- return 'CREATE ' . $this->options->build() . ' ' . $this->name->build() . ' ' . $fields . ' AS ' . $builtStatement . TokensList::buildFromArray($this->body) . ' ' . ($this->entityOptions?->build() ?? '');
+ return 'CREATE ' . $this->options->build() . ' ' . $this->name->build() . ' ' . $fields . ' AS ' . $builtStatement . TokensList::buildFromArray($this->body) . ' ' . ('' ?? $this->entityOptions?->build());
}
if ($this->options->has('TRIGGER')) {
return 'CREATE ' . $this->options->build() . ' ' . $this->name->build() . ' ' . $this->entityOptions->build() . ' ' . 'ON ' . $this->table->build() . ' ' . 'FOR EACH ROW ' . TokensList::buildFromArray($this->body);
|
Mutation tests with PHP 8.2:
src/Statements/CreateStatement.php#L537
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
* Token parsed at this moment.
*/
$token = $list->tokens[$list->idx];
- $nextidx = $list->idx + 1;
+ $nextidx = $list->idx + 2;
while ($nextidx < $list->count && $list->tokens[$nextidx]->type === TokenType::Whitespace) {
++$nextidx;
}
|
Mutation tests with PHP 8.2:
src/Statements/CreateStatement.php#L552
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
} elseif ($token->type === TokenType::Keyword && $token->keyword === 'WITH') {
/* CREATE TABLE WITH */
$this->with = new WithStatement($parser, $list);
- } elseif ($token->type === TokenType::Keyword && $token->keyword === 'AS' && $list->tokens[$nextidx]->type === TokenType::Keyword) {
+ } elseif (($token->type === TokenType::Keyword || $token->keyword === 'AS') && $list->tokens[$nextidx]->type === TokenType::Keyword) {
if ($list->tokens[$nextidx]->value === 'SELECT') {
/* CREATE TABLE ... AS SELECT */
$list->idx = $nextidx;
|
Mutation tests with PHP 8.2:
src/Statements/CreateStatement.php#L564
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
$list->idx = $nextidx;
$this->with = new WithStatement($parser, $list);
}
- } elseif ($token->type === TokenType::Keyword && $token->keyword === 'LIKE') {
+ } elseif ($token->type === TokenType::Keyword || $token->keyword === 'LIKE') {
/* CREATE TABLE `new_tbl` LIKE 'orig_tbl' */
$list->idx = $nextidx;
$this->like = Expressions::parse($parser, $list, ['parseField' => 'table', 'breakOnAlias' => true]);
|
Mutation tests with PHP 8.2:
src/Statements/CreateStatement.php#L572
Escaped Mutant for Mutator "TrueValue":
--- Original
+++ New
@@ @@
} elseif ($token->type === TokenType::Keyword && $token->keyword === 'LIKE') {
/* CREATE TABLE `new_tbl` LIKE 'orig_tbl' */
$list->idx = $nextidx;
- $this->like = Expressions::parse($parser, $list, ['parseField' => 'table', 'breakOnAlias' => true]);
+ $this->like = Expressions::parse($parser, $list, ['parseField' => 'table', 'breakOnAlias' => false]);
// The 'LIKE' keyword was found, but no table_name was found next to it
if ($this->like === null) {
$parser->error('A table name was expected.', $list->tokens[$list->idx]);
|
Mutation tests with PHP 8.2:
src/Statements/CreateStatement.php#L600
Escaped Mutant for Mutator "FalseValue":
--- Original
+++ New
@@ @@
* previously. At least one bracket is required to validate the
* expression.
*/
- $brackets = false;
+ $brackets = true;
/*
* Handles partitions.
*/
|
Mutation tests with PHP 8.2:
src/Statements/CreateStatement.php#L605
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
/*
* Handles partitions.
*/
- for (; $list->idx < $list->count; ++$list->idx) {
+ for (; $list->idx <= $list->count; ++$list->idx) {
/**
* Token parsed at this moment.
*/
|