Skip to content

Refactor array, structured and JSON expression builders. #1501

Refactor array, structured and JSON expression builders.

Refactor array, structured and JSON expression builders. #1501

Triggered via pull request February 26, 2025 08:49
Status Success
Total duration 16m 27s
Artifacts

mutation.yml

on: pull_request
Matrix: mutation
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
PHP 8.3-ubuntu-latest: src/Builder/ArrayExpressionBuilder.php#L37
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ $param = new Param($value, DataType::STRING); $column = $this->getColumn($expression); $dbType = $this->getColumnDbType($column); - $typeHint = $this->getTypeHint($dbType, $column?->getDimension() ?? 1); + $typeHint = $this->getTypeHint($dbType, $column?->getDimension() ?? 0); return $this->queryBuilder->bindParam($param, $params) . $typeHint; } protected function buildSubquery(QueryInterface $query, ArrayExpression $expression, array &$params) : string
PHP 8.3-ubuntu-latest: src/Builder/ArrayExpressionBuilder.php#L37
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ $param = new Param($value, DataType::STRING); $column = $this->getColumn($expression); $dbType = $this->getColumnDbType($column); - $typeHint = $this->getTypeHint($dbType, $column?->getDimension() ?? 1); + $typeHint = $this->getTypeHint($dbType, $column?->getDimension() ?? 2); return $this->queryBuilder->bindParam($param, $params) . $typeHint; } protected function buildSubquery(QueryInterface $query, ArrayExpression $expression, array &$params) : string
PHP 8.3-ubuntu-latest: src/Builder/ArrayExpressionBuilder.php#L47
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ { $column = $this->getColumn($expression); $dbType = $this->getColumnDbType($column); - return $this->buildNestedSubquery($query, $dbType, $column?->getDimension() ?? 1, $params); + return $this->buildNestedSubquery($query, $dbType, $column?->getDimension() ?? 0, $params); } protected function buildValue(iterable $value, ArrayExpression $expression, array &$params) : string {
PHP 8.3-ubuntu-latest: src/Builder/ArrayExpressionBuilder.php#L47
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ { $column = $this->getColumn($expression); $dbType = $this->getColumnDbType($column); - return $this->buildNestedSubquery($query, $dbType, $column?->getDimension() ?? 1, $params); + return $this->buildNestedSubquery($query, $dbType, $column?->getDimension() ?? 2, $params); } protected function buildValue(iterable $value, ArrayExpression $expression, array &$params) : string {
PHP 8.3-ubuntu-latest: src/Builder/ArrayExpressionBuilder.php#L186
Escaped Mutant for Mutator "FalseValue": --- Original +++ New @@ @@ return $value; } if (!is_array($value)) { - $value = iterator_to_array($value, false); + $value = iterator_to_array($value, true); } return array_map($column->dbTypecast(...), $value); } }
PHP 8.3-ubuntu-latest: src/Column/ColumnFactory.php#L170
Escaped Mutant for Mutator "UnwrapSubstr": --- Original +++ New @@ @@ { $value = preg_replace("/::[^:']+\$/", '$1', $defaultValue); if (str_starts_with($value, "B'") && $value[-1] === "'") { - return $column->phpTypecast(substr($value, 2, -1)); + return $column->phpTypecast($value); } $value = parent::normalizeNotNullDefaultValue($value, $column); if ($value instanceof Expression) {
PHP 8.3-ubuntu-latest: src/Data/ArrayParser.php#L43
Escaped Mutant for Mutator "Increment": --- Original +++ New @@ @@ private function parseArray(string $value, int &$i = 0) : array { if ($value[++$i] === '}') { - ++$i; + --$i; return []; } for ($result = [];; ++$i) {
PHP 8.3-ubuntu-latest: src/SqlParser.php#L16
Escaped Mutant for Mutator "LessThan": --- Original +++ New @@ @@ { $result = null; $length = $this->length - 1; - while ($this->position < $length) { + while ($this->position <= $length) { $pos = $this->position++; match ($this->sql[$pos]) { ':' => ($word = $this->parseWord()) === '' ? $this->skipChars(':') : ($result = ':' . $word),
PHP 8.3-ubuntu-latest: src/SqlParser.php#L24
Escaped Mutant for Mutator "Identical": --- Original +++ New @@ @@ match ($this->sql[$pos]) { ':' => ($word = $this->parseWord()) === '' ? $this->skipChars(':') : ($result = ':' . $word), '"', "'" => $this->skipQuotedWithoutEscape($this->sql[$pos]), - 'e', 'E' => $this->sql[$this->position] === "'" ? ++$this->position && $this->skipQuotedWithEscape("'") : $this->skipIdentifier(), + 'e', 'E' => $this->sql[$this->position] !== "'" ? ++$this->position && $this->skipQuotedWithEscape("'") : $this->skipIdentifier(), '$' => $this->skipQuotedWithDollar(), '-' => $this->sql[$this->position] === '-' ? ++$this->position && $this->skipToAfterChar("\n") : null, '/' => $this->sql[$this->position] === '*' ? ++$this->position && $this->skipToAfterString('*/') : null,
PHP 8.3-ubuntu-latest: src/SqlParser.php#L24
Escaped Mutant for Mutator "Ternary": --- Original +++ New @@ @@ match ($this->sql[$pos]) { ':' => ($word = $this->parseWord()) === '' ? $this->skipChars(':') : ($result = ':' . $word), '"', "'" => $this->skipQuotedWithoutEscape($this->sql[$pos]), - 'e', 'E' => $this->sql[$this->position] === "'" ? ++$this->position && $this->skipQuotedWithEscape("'") : $this->skipIdentifier(), + 'e', 'E' => $this->sql[$this->position] === "'" ? $this->skipIdentifier() : ++$this->position && $this->skipQuotedWithEscape("'"), '$' => $this->skipQuotedWithDollar(), '-' => $this->sql[$this->position] === '-' ? ++$this->position && $this->skipToAfterChar("\n") : null, '/' => $this->sql[$this->position] === '*' ? ++$this->position && $this->skipToAfterString('*/') : null,