Improve performance of ArrayParser::parse() method
#1772
Annotations
1 error and 10 warnings
|
PHP 8.5-ubuntu-latest
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires vimeo/psalm ^5.26.1 || ^6.8.8 -> satisfiable by vimeo/psalm[5.26.1, 6.8.8, ..., 6.13.1].
- vimeo/psalm 5.26.1 requires php ^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 -> your php version (8.5.0) does not satisfy that requirement.
- vimeo/psalm[6.8.8, ..., 6.13.1] require php ~8.1.31 || ~8.2.27 || ~8.3.16 || ~8.4.3 -> your php version (8.5.0) does not satisfy that requirement.
|
|
PHP 8.5-ubuntu-latest:
src/Column/BitColumnInternal.php#L41
Escaped Mutant for Mutator "CastString":
@@ @@
'NULL' => null,
'boolean' => self::addZero($value ? '1' : '0', $size),
'string' => $value === '' ? null : $value,
- default => $value instanceof ExpressionInterface ? $value : (string) $value,
+ default => $value instanceof ExpressionInterface ? $value : $value,
};
}
private static function addZero(string $value, ?int $size): string
|
|
PHP 8.5-ubuntu-latest:
src/Column/AbstractRangeColumn.php#L88
Escaped Mutant for Mutator "MatchArmRemoval":
@@ @@
'NULL' => '',
'double', 'integer' => (string) $value,
'string' => $value,
- default => throw new NotSupportedException(sprintf('Range bound supports only string, int, float and null values. Got %s.', get_debug_type($value))),
};
}
}
|
|
PHP 8.5-ubuntu-latest:
src/Builder/ArrayValueBuilder.php#L192
Escaped Mutant for Mutator "FalseValue":
@@ @@
private function dbTypecast(iterable $value, ColumnInterface $column): iterable
{
if (!is_array($value)) {
- $value = iterator_to_array($value, false);
+ $value = iterator_to_array($value, true);
}
return array_map($column->dbTypecast(...), $value);
}
}
|
|
PHP 8.5-ubuntu-latest:
src/Builder/ArrayValueBuilder.php#L49
Escaped Mutant for Mutator "Coalesce":
@@ @@
{
$column = $this->getColumn($expression);
$dbType = $this->getColumnDbType($column);
- return $this->buildNestedSubquery($query, $dbType, $column?->getDimension() ?? 1, $params);
+ return $this->buildNestedSubquery($query, $dbType, 1 ?? $column?->getDimension(), $params);
}
protected function buildValue(iterable $value, ArrayValue $expression, array &$params): string
{
|
|
PHP 8.5-ubuntu-latest:
src/Builder/ArrayValueBuilder.php#L49
Escaped Mutant for Mutator "IncrementInteger":
@@ @@
{
$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, ArrayValue $expression, array &$params): string
{
|
|
PHP 8.5-ubuntu-latest:
src/Builder/ArrayValueBuilder.php#L49
Escaped Mutant for Mutator "DecrementInteger":
@@ @@
{
$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, ArrayValue $expression, array &$params): string
{
|
|
PHP 8.5-ubuntu-latest:
src/Builder/ArrayValueBuilder.php#L39
Escaped Mutant for Mutator "Coalesce":
@@ @@
$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, 1 ?? $column?->getDimension());
return $this->queryBuilder->bindParam($param, $params) . $typeHint;
}
protected function buildSubquery(QueryInterface $query, ArrayValue $expression, array &$params): string
|
|
PHP 8.5-ubuntu-latest:
src/Builder/ArrayValueBuilder.php#L39
Escaped Mutant for Mutator "IncrementInteger":
@@ @@
$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, ArrayValue $expression, array &$params): string
|
|
PHP 8.5-ubuntu-latest:
src/Builder/ArrayValueBuilder.php#L39
Escaped Mutant for Mutator "DecrementInteger":
@@ @@
$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, ArrayValue $expression, array &$params): string
|
|
PHP 8.5-ubuntu-latest:
src/Builder/ArrayValueBuilder.php#L39
Escaped Mutant for Mutator "NullSafeMethodCall":
@@ @@
$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() ?? 1);
return $this->queryBuilder->bindParam($param, $params) . $typeHint;
}
protected function buildSubquery(QueryInterface $query, ArrayValue $expression, array &$params): string
|