Add some more return types #450
This run and associated checks have been archived and are scheduled for deletion.
Learn more about checks retention
Annotations
11 warnings
Mutation tests with PHP 8.1:
src/Statement.php#L107
Escaped Mutant for Mutator "LogicalOr":
--- Original
+++ New
@@ @@
*/
public function __construct(Parser|null $parser = null, TokensList|null $list = null)
{
- if ($parser === null || $list === null) {
+ if ($parser === null && $list === null) {
return;
}
$this->parse($parser, $list);
|
Mutation tests with PHP 8.1:
src/Statement.php#L191
Escaped Mutant for Mutator "UnwrapTrim":
--- Original
+++ New
@@ @@
}
// Checking if the name of the clause should be added.
if ($type & 2) {
- $query = trim($query) . ' ' . $name;
+ $query = $query . ' ' . $name;
}
// Checking if the result of the builder should be added.
if (!($type & 1)) {
|
Mutation tests with PHP 8.1:
src/Statement.php#L202
Escaped Mutant for Mutator "UnwrapTrim":
--- Original
+++ New
@@ @@
if (is_array($this->{$field})) {
$query = trim($query) . ' ' . $class::buildAll($this->{$field});
} else {
- $query = trim($query) . ' ' . $class::build($this->{$field});
+ $query = $query . ' ' . $class::build($this->{$field});
}
}
return $query;
|
Mutation tests with PHP 8.1:
src/Statement.php#L217
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
*
* @throws Exceptions\ParserException
*/
- public function parse(Parser $parser, TokensList $list) : void
+ protected function parse(Parser $parser, TokensList $list) : void
{
/**
* Array containing all list of clauses parsed.
|
Mutation tests with PHP 8.1:
src/Statement.php#L280
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
// ON DUPLICATE KEY UPDATE ...
// has to be parsed in parent statement (INSERT or REPLACE)
// so look for it and break
- if ($this instanceof Statements\SelectStatement && $token->value === 'ON') {
+ if (true && $token->value === 'ON') {
++$list->idx;
// Skip ON
// look for ON DUPLICATE KEY UPDATE
|
Mutation tests with PHP 8.1:
src/Statement.php#L280
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
// ON DUPLICATE KEY UPDATE ...
// has to be parsed in parent statement (INSERT or REPLACE)
// so look for it and break
- if ($this instanceof Statements\SelectStatement && $token->value === 'ON') {
+ if ($this instanceof Statements\SelectStatement || $token->value === 'ON') {
++$list->idx;
// Skip ON
// look for ON DUPLICATE KEY UPDATE
|
Mutation tests with PHP 8.1:
src/Statement.php#L289
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
$first = $list->getNextOfType(Token::TYPE_KEYWORD);
$second = $list->getNextOfType(Token::TYPE_KEYWORD);
$third = $list->getNextOfType(Token::TYPE_KEYWORD);
- if ($first && $second && $third && $first->value === 'DUPLICATE' && $second->value === 'KEY' && $third->value === 'UPDATE') {
+ if (($first || $second) && $third && $first->value === 'DUPLICATE' && $second->value === 'KEY' && $third->value === 'UPDATE') {
$list->idx = $lastIdx;
break;
}
|
Mutation tests with PHP 8.1:
src/Statement.php#L289
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
$first = $list->getNextOfType(Token::TYPE_KEYWORD);
$second = $list->getNextOfType(Token::TYPE_KEYWORD);
$third = $list->getNextOfType(Token::TYPE_KEYWORD);
- if ($first && $second && $third && $first->value === 'DUPLICATE' && $second->value === 'KEY' && $third->value === 'UPDATE') {
+ if (($first && $second || $third) && $first->value === 'DUPLICATE' && $second->value === 'KEY' && $third->value === 'UPDATE') {
$list->idx = $lastIdx;
break;
}
|
Mutation tests with PHP 8.1:
src/Statement.php#L289
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
$first = $list->getNextOfType(Token::TYPE_KEYWORD);
$second = $list->getNextOfType(Token::TYPE_KEYWORD);
$third = $list->getNextOfType(Token::TYPE_KEYWORD);
- if ($first && $second && $third && $first->value === 'DUPLICATE' && $second->value === 'KEY' && $third->value === 'UPDATE') {
+ if (($first && $second && $third || $first->value === 'DUPLICATE') && $second->value === 'KEY' && $third->value === 'UPDATE') {
$list->idx = $lastIdx;
break;
}
|
Mutation tests with PHP 8.1:
src/Statement.php#L289
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
$first = $list->getNextOfType(Token::TYPE_KEYWORD);
$second = $list->getNextOfType(Token::TYPE_KEYWORD);
$third = $list->getNextOfType(Token::TYPE_KEYWORD);
- if ($first && $second && $third && $first->value === 'DUPLICATE' && $second->value === 'KEY' && $third->value === 'UPDATE') {
+ if (($first && $second && $third && $first->value === 'DUPLICATE' || $second->value === 'KEY') && $third->value === 'UPDATE') {
$list->idx = $lastIdx;
break;
}
|
Mutation tests with PHP 8.1
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/
|