Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 3 additions & 81 deletions analyzer-baseline.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ count = 1
file = "src/RowGateway/AbstractRowGateway.php"
code = "possibly-null-array-access"
message = "Cannot perform array access on possibly `null` value."
count = 4
count = 3

[[issues]]
file = "src/RowGateway/AbstractRowGateway.php"
Expand Down Expand Up @@ -282,60 +282,6 @@ code = "missing-return-type"
message = "Function `__unset` is missing a return type hint."
count = 1

[[issues]]
file = "src/Sql/Platform/Platform.php"
code = "class-must-be-final"
message = 'Class `PhpDb\Sql\Platform\Platform` should be declared `final`.'
count = 1

[[issues]]
file = "src/Sql/Platform/Platform.php"
code = "mixed-array-assignment"
message = "Unsafe array assignment on type `mixed`."
count = 1

[[issues]]
file = "src/Sql/Platform/Platform.php"
code = "mixed-return-statement"
message = 'Could not infer a precise return type for function `PhpDb\Sql\Platform\Platform::getDecorators`. Saw type `mixed`.'
count = 1

[[issues]]
file = "src/Sql/Platform/Platform.php"
code = "non-existent-method"
message = 'Method `getSqlString` does not exist on type `PhpDb\Sql\Platform\PlatformDecoratorInterface`.'
count = 1

[[issues]]
file = "src/Sql/Platform/Platform.php"
code = "non-existent-method"
message = 'Method `getSqlString` does not exist on type `PhpDb\Sql\PreparableSqlInterface`.'
count = 1

[[issues]]
file = "src/Sql/Platform/Platform.php"
code = "non-existent-method"
message = 'Method `prepareStatement` does not exist on type `PhpDb\Sql\Platform\PlatformDecoratorInterface`.'
count = 1

[[issues]]
file = "src/Sql/Platform/Platform.php"
code = "non-existent-method"
message = 'Method `prepareStatement` does not exist on type `PhpDb\Sql\SqlInterface`.'
count = 1

[[issues]]
file = "src/Sql/Platform/Platform.php"
code = "possibly-undefined-string-array-index"
message = "Possibly undefined array key `string` accessed on `array<array-key, mixed>`."
count = 1

[[issues]]
file = "src/Sql/Platform/PlatformDecoratorInterface.php"
code = "missing-api-or-internal"
message = 'Interface `PhpDb\Sql\Platform\PlatformDecoratorInterface` is missing an `@api` or `@internal` annotation.'
count = 1

[[issues]]
file = "src/Sql/Select.php"
code = "missing-return-type"
Expand Down Expand Up @@ -414,12 +360,6 @@ code = "invalid-property-assignment-value"
message = "Invalid type for property `$lastInsertValue`: expected `int`, but got `false|int|null|string`."
count = 1

[[issues]]
file = "src/TableGateway/AbstractTableGateway.php"
code = "invalid-return-statement"
message = 'Invalid return type for function `PhpDb\TableGateway\AbstractTableGateway::executeSelect`: expected `PhpDb\ResultSet\ResultSetInterface<mixed>`, but found `PhpDb\ResultSet\ResultSetInterface<mixed>|null`.'
count = 1

[[issues]]
file = "src/TableGateway/AbstractTableGateway.php"
code = "invalid-return-statement"
Expand Down Expand Up @@ -544,7 +484,7 @@ count = 6
file = "src/TableGateway/AbstractTableGateway.php"
code = "mixed-assignment"
message = "Assigning `mixed` type to a variable may lead to unexpected behavior."
count = 9
count = 8

[[issues]]
file = "src/TableGateway/AbstractTableGateway.php"
Expand All @@ -558,12 +498,6 @@ code = "mixed-clone"
message = "Cannot statically verify `clone` on a `mixed` type."
count = 1

[[issues]]
file = "src/TableGateway/AbstractTableGateway.php"
code = "nullable-return-statement"
message = 'Function `PhpDb\TableGateway\AbstractTableGateway::executeSelect` is declared to return `PhpDb\ResultSet\ResultSetInterface<mixed>` but possibly returns a nullable value (inferred as `PhpDb\ResultSet\ResultSetInterface<mixed>|null`).'
count = 1

[[issues]]
file = "src/TableGateway/AbstractTableGateway.php"
code = "nullable-return-statement"
Expand All @@ -588,17 +522,11 @@ code = "nullable-return-statement"
message = 'Function `PhpDb\TableGateway\AbstractTableGateway::getTable` is declared to return `PhpDb\Sql\TableIdentifier|array<array-key, mixed>|string` but possibly returns a nullable value (inferred as `PhpDb\Sql\TableIdentifier|array<array-key, mixed>|null|string`).'
count = 1

[[issues]]
file = "src/TableGateway/AbstractTableGateway.php"
code = "overly-wide-return-type"
message = "Declared return type `false|int|null|string` for `getlastinsertvalue` has unused branches: `false`, `string`, `null`."
count = 1

[[issues]]
file = "src/TableGateway/AbstractTableGateway.php"
code = "possible-method-access-on-null"
message = "Attempting to call a method on `null`."
count = 28
count = 27

[[issues]]
file = "src/TableGateway/AbstractTableGateway.php"
Expand Down Expand Up @@ -630,12 +558,6 @@ code = "possibly-undefined-int-array-index"
message = 'Possibly undefined array index accessed on `list<PhpDb\Sql\ExpressionInterface|PhpDb\Sql\Select|null|scalar>`.'
count = 3

[[issues]]
file = "src/TableGateway/AbstractTableGateway.php"
code = "possibly-undefined-string-array-index"
message = '''Possibly undefined array key `string('table')` accessed on `array<string, PhpDb\Sql\TableIdentifier|array<array-key, mixed>|string>`.'''
count = 1

[[issues]]
file = "src/TableGateway/AbstractTableGateway.php"
code = "possibly-undefined-string-array-index"
Expand Down
4 changes: 2 additions & 2 deletions src/Adapter/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public function getHelpers(): array
self::FUNCTION_QUOTE_IDENTIFIER => static fn(string $value): string => $platform->quoteIdentifier(
$value,
),
self::FUNCTION_QUOTE_VALUE => $platform->quoteValue(...),
default => null,
self::FUNCTION_QUOTE_VALUE => $platform->quoteValue(...),
default => null,
};
if (null !== $function) {
$functions[] = $function;
Expand Down
4 changes: 2 additions & 2 deletions src/Adapter/Driver/Pdo/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
throw Exception\InvalidArgumentException::forInvalidFetchMode();
}

$this->fetchMode = (int) $fetchMode;

Check warning on line 280 in src/Adapter/Driver/Pdo/Result.php

View workflow job for this annotation

GitHub Actions / qa / Mutation testing

Escaped Mutant for Mutator "CastInt": @@ @@ throw Exception\InvalidArgumentException::forInvalidFetchMode(); } - $this->fetchMode = (int) $fetchMode; + $this->fetchMode = $fetchMode; } public function setStatementMode(string $statementMode = self::STATEMENT_MODE_FORWARD): void
}

public function setStatementMode(string $statementMode = self::STATEMENT_MODE_FORWARD): void
Expand Down Expand Up @@ -307,9 +307,9 @@
$rowCount = $this->rowCount;

return match (true) {
is_int($rowCount) => $rowCount,
is_int($rowCount) => $rowCount,
$rowCount instanceof Closure => (int) $rowCount(),
default => $this->resource->rowCount(),
default => $this->resource->rowCount(),
};
}
}
2 changes: 1 addition & 1 deletion src/Adapter/Driver/Pdo/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ private function toPdoType(mixed $errata, mixed $value): int
is_int($value) => PDO::PARAM_INT,
is_bool($value) => PDO::PARAM_BOOL,
null === $value => PDO::PARAM_NULL,
default => PDO::PARAM_STR,
default => PDO::PARAM_STR,
};
}

Expand Down
6 changes: 2 additions & 4 deletions src/Adapter/ParameterContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ public function offsetSet(mixed $offset, mixed $value, mixed $errata = null, mix
? substr($offset, offset: 1)
: $offset]
?? $offset,
null === $offset => (string) count($this->data),
default => throw Exception\InvalidArgumentException::forInvalidKeyType(),
null === $offset => (string) count($this->data),
default => throw Exception\InvalidArgumentException::forInvalidKeyType(),
};

$isNewPosition = is_int($offset)
Expand Down Expand Up @@ -310,8 +310,6 @@ public function offsetSetMaxLength(string|int $name, mixed $maxLength): void
/**
* Bind a parameter to another by reference. Referencing a name that is not set creates it
* as null, so the two stay bound when either is set later.
*
* @mago-expect analysis:possibly-undefined-string-array-index
*/
public function offsetSetReference(string|int $name, string|int $from): void
{
Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/Profiler/Profiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function getLastProfile(): ?array
{
$lastIndex = array_key_last($this->profiles);

return null === $lastIndex ? null : $this->profiles[$lastIndex] ?? null;
return null === $lastIndex ? null : $this->profiles[$lastIndex];
}

/**
Expand Down
6 changes: 6 additions & 0 deletions src/Container/AdapterInterfaceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
* @throws ContainerException If the config service, the adapter configuration or its driver is missing.
* @throws ContainerExceptionInterface If a dependency cannot be built.
* @throws NotFoundExceptionInterface If a dependency cannot be resolved.
*
* Mago reads ServiceManager::get()'s class-string conditional return as `object`
* for the 'config' id, which is an array (or null) at runtime.
*
* @mago-expect analysis:docblock-type-mismatch
* @mago-expect analysis:redundant-null-coalesce
*/
public function __invoke(
ContainerInterface&ServiceManager $container,
Expand Down Expand Up @@ -50,7 +56,7 @@

$driver = $container->build($driverClass, $adapterConfig);

$adapterPlatform = $container->build(PlatformInterface::class, ['driver' => $driver]);

Check warning on line 59 in src/Container/AdapterInterfaceFactory.php

View workflow job for this annotation

GitHub Actions / qa / Mutation testing

Escaped Mutant for Mutator "ArrayItemRemoval": @@ @@ $driver = $container->build($driverClass, $adapterConfig); - $adapterPlatform = $container->build(PlatformInterface::class, ['driver' => $driver]); + $adapterPlatform = $container->build(PlatformInterface::class, []); $profilerInterface = $container->has(ProfilerInterface::class) ? $container->build(ProfilerInterface::class)

$profilerInterface = $container->has(ProfilerInterface::class)
? $container->build(ProfilerInterface::class)
Expand Down
11 changes: 6 additions & 5 deletions src/Metadata/Source/AbstractSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ abstract class AbstractSource implements MetadataInterface
public function __construct(
protected AdapterInterface&SchemaAwareInterface $adapter,
) {
$currentSchema = $this->adapter->getCurrentSchema();
$this->defaultSchema = false !== $currentSchema && '' !== $currentSchema
? $currentSchema
: self::DEFAULT_SCHEMA;
$currentSchema = $this->adapter->getCurrentSchema();
$this->defaultSchema =
false !== $currentSchema && '' !== $currentSchema
? $currentSchema
: self::DEFAULT_SCHEMA;
}

/**
Expand Down Expand Up @@ -694,7 +695,6 @@ protected function loadTriggerData(string $schema): void
* on every iteration, which does not terminate in useful time on Mago
* 1.47.5 and later.
*
* @mago-expect analysis:mixed-assignment
* @mago-expect lint:no-isset
*/
protected function prepareDataHierarchy(string $type, string ...$keys): void
Expand All @@ -706,6 +706,7 @@ protected function prepareDataHierarchy(string $type, string ...$keys): void
$data[$key] = [];
}

/** @var array<array-key, mixed> $data */
$data = &$data[$key];
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/ResultSet/AbstractResultSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@
*/
private static function resolveIterator(Traversable $dataSource): Iterator
{
$depth = 0;

Check warning on line 115 in src/ResultSet/AbstractResultSet.php

View workflow job for this annotation

GitHub Actions / qa / Mutation testing

Escaped Mutant for Mutator "DecrementInteger": @@ @@ */ private static function resolveIterator(Traversable $dataSource): Iterator { - $depth = 0; + $depth = -1; while ($dataSource instanceof IteratorAggregate) { if (++$depth > self::MAX_ITERATOR_DEPTH) { throw InvalidArgumentException::forUnresolvableIterator(self::MAX_ITERATOR_DEPTH);
while ($dataSource instanceof IteratorAggregate) {
if (++$depth > self::MAX_ITERATOR_DEPTH) {

Check warning on line 117 in src/ResultSet/AbstractResultSet.php

View workflow job for this annotation

GitHub Actions / qa / Mutation testing

Escaped Mutant for Mutator "GreaterThan": @@ @@ { $depth = 0; while ($dataSource instanceof IteratorAggregate) { - if (++$depth > self::MAX_ITERATOR_DEPTH) { + if (++$depth >= self::MAX_ITERATOR_DEPTH) { throw InvalidArgumentException::forUnresolvableIterator(self::MAX_ITERATOR_DEPTH); }
throw InvalidArgumentException::forUnresolvableIterator(self::MAX_ITERATOR_DEPTH);
}

$dataSource = $dataSource->getIterator();
}

if ($dataSource instanceof Iterator) {

Check warning on line 124 in src/ResultSet/AbstractResultSet.php

View workflow job for this annotation

GitHub Actions / qa / Mago (PHP 8.4)

redundant-condition

This condition (type `true`) will always evaluate to true. >Expression of type `true` is always truthy Because this condition is always true, the code block it controls will always execute if this part of the code is reached. The explicit condition might be redundant. Help: Consider simplifying or removing the conditional check if the guarded code should always execute, or verify the expression's logic if a conditional check is truly needed.

Check warning on line 124 in src/ResultSet/AbstractResultSet.php

View workflow job for this annotation

GitHub Actions / qa / Mago (PHP 8.5)

redundant-condition

This condition (type `true`) will always evaluate to true. >Expression of type `true` is always truthy Because this condition is always true, the code block it controls will always execute if this part of the code is reached. The explicit condition might be redundant. Help: Consider simplifying or removing the conditional check if the guarded code should always execute, or verify the expression's logic if a conditional check is truly needed.

Check warning on line 124 in src/ResultSet/AbstractResultSet.php

View workflow job for this annotation

GitHub Actions / qa / Mago (PHP 8.3)

redundant-condition

This condition (type `true`) will always evaluate to true. >Expression of type `true` is always truthy Because this condition is always true, the code block it controls will always execute if this part of the code is reached. The explicit condition might be redundant. Help: Consider simplifying or removing the conditional check if the guarded code should always execute, or verify the expression's logic if a conditional check is truly needed.
return $dataSource;
}

Expand All @@ -141,14 +141,14 @@
}

if (RowBufferState::Pending !== $this->bufferState) {
return $this;

Check warning on line 144 in src/ResultSet/AbstractResultSet.php

View workflow job for this annotation

GitHub Actions / qa / Mutation testing

Escaped Mutant for Mutator "ReturnRemoval": @@ @@ } if (RowBufferState::Pending !== $this->bufferState) { - return $this; + } $this->setBufferState(RowBufferState::Storing);
}

$this->setBufferState(RowBufferState::Storing);
$this->sourcePosition = 0;

if ($this->dataSource instanceof ResultInterface) {
$this->dataSource->rewind();

Check warning on line 151 in src/ResultSet/AbstractResultSet.php

View workflow job for this annotation

GitHub Actions / qa / Mutation testing

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ $this->sourcePosition = 0; if ($this->dataSource instanceof ResultInterface) { - $this->dataSource->rewind(); + } return $this;
}

return $this;
Expand All @@ -162,7 +162,7 @@
public function count(): ?int
{
if (null !== $this->count) {
return $this->count;

Check warning on line 165 in src/ResultSet/AbstractResultSet.php

View workflow job for this annotation

GitHub Actions / qa / Mutation testing

Escaped Mutant for Mutator "ReturnRemoval": @@ @@ public function count(): ?int { if (null !== $this->count) { - return $this->count; + } if ($this->dataSource instanceof Countable) {
}

if ($this->dataSource instanceof Countable) {
Expand Down Expand Up @@ -213,10 +213,10 @@

$this->fieldCount = match (true) {
$row instanceof Countable => $row->count(),
is_array($row) => count($row),
is_object($row) => count(get_mangled_object_vars($row)),
null === $row => 0,
default => 1,
is_array($row) => count($row),
is_object($row) => count(get_mangled_object_vars($row)),
null === $row => 0,
default => 1,
};

return $this->fieldCount;
Expand Down
4 changes: 3 additions & 1 deletion src/ResultSet/RowPrototypeResultSetInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ interface RowPrototypeResultSetInterface
{
public function getRowPrototype(): RowPrototypeInterface;

public function setRowPrototype(RowPrototypeInterface $rowPrototype): ResultSetInterface&RowPrototypeResultSetInterface;
public function setRowPrototype(
RowPrototypeInterface $rowPrototype,
): ResultSetInterface&RowPrototypeResultSetInterface;
}
22 changes: 11 additions & 11 deletions src/Sql/AbstractSql.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
null === $namedParameterPrefix || '' === $namedParameterPrefix => $parameterContainer
? 'expr' . $this->processInfo['expressionCount']++ . 'Param'
: '',
default => $this->processInfo['paramPrefix']
default => $this->processInfo['paramPrefix']
. str_replace([' ', "\t", "\n", "\r"], replace: '__', subject: $namedParameterPrefix),
};

Expand All @@ -258,7 +258,7 @@

foreach ($expressionValues as $vIndex => $argument) {
$values[] = match (true) {
$argument instanceof Value => $parameterContainer instanceof ParameterContainer
$argument instanceof Value => $parameterContainer instanceof ParameterContainer
&& $driver instanceof DriverInterface
? $this->processExpressionParameterName(
$argument->getValue(),
Expand All @@ -268,9 +268,9 @@
$parameterContainer,
)
: $platform->quoteValue((string) $argument->getValue()),
$argument instanceof Identifier => IdentifierQuoter::quote($argument->getValue(), $platform),
$argument instanceof Literal => $argument->getValue(),
$argument instanceof Identifiers => $this->processIdentifiersArgument($argument, $platform),
$argument instanceof Identifier => IdentifierQuoter::quote($argument->getValue(), $platform),
$argument instanceof Literal => $argument->getValue(),
$argument instanceof Identifiers => $this->processIdentifiersArgument($argument, $platform),
$argument instanceof SelectArgument => $this->processExpressionOrSelect(
$argument,
$namedParameterPrefix,
Expand Down Expand Up @@ -327,7 +327,7 @@
$parameterContainer,
"{$namedParameterPrefix}{$vIndex}subpart",
),
default => throw Exception\InvalidArgumentException::forInvalidArgumentType(),
default => throw Exception\InvalidArgumentException::forInvalidArgumentType(),
};
}

Expand Down Expand Up @@ -380,19 +380,19 @@
if (is_array($joinName)) {
$alias = array_key_first($joinName);
$joinAs = $platform->quoteIdentifier($alias);
$joinName = $joinName[$alias] ?? '';

Check notice on line 383 in src/Sql/AbstractSql.php

View workflow job for this annotation

GitHub Actions / qa / Mago (PHP 8.4)

redundant-null-coalesce

Redundant null coalesce: left-hand side can never be `null` or undefined. >This expression (type `PhpDb\Sql\Expression|PhpDb\Sql\Select|PhpDb\Sql\TableIdentifier|string`) is never `null` or undefined >This right-hand side will never be evaluated The null coalesce operator `??` only evaluates the right-hand side if the left-hand side is `null` or not set. Help: Consider removing the `??` operator and the right-hand side expression.

Check notice on line 383 in src/Sql/AbstractSql.php

View workflow job for this annotation

GitHub Actions / qa / Mago (PHP 8.5)

redundant-null-coalesce

Redundant null coalesce: left-hand side can never be `null` or undefined. >This expression (type `PhpDb\Sql\Expression|PhpDb\Sql\Select|PhpDb\Sql\TableIdentifier|string`) is never `null` or undefined >This right-hand side will never be evaluated The null coalesce operator `??` only evaluates the right-hand side if the left-hand side is `null` or not set. Help: Consider removing the `??` operator and the right-hand side expression.

Check notice on line 383 in src/Sql/AbstractSql.php

View workflow job for this annotation

GitHub Actions / qa / Mago (PHP 8.3)

redundant-null-coalesce

Redundant null coalesce: left-hand side can never be `null` or undefined. >This expression (type `PhpDb\Sql\Expression|PhpDb\Sql\Select|PhpDb\Sql\TableIdentifier|string`) is never `null` or undefined >This right-hand side will never be evaluated The null coalesce operator `??` only evaluates the right-hand side if the left-hand side is `null` or not set. Help: Consider removing the `??` operator and the right-hand side expression.
}

$joinName = match (true) {
$joinName instanceof Expression => $joinName->getExpression(),
$joinName instanceof Expression => $joinName->getExpression(),
$joinName instanceof TableIdentifier => $this->quoteJoinTableIdentifier($joinName, $platform),
$joinName instanceof Select => "({$this->processSubSelect(
$joinName instanceof Select => "({$this->processSubSelect(
$joinName,
$platform,
$driver,
$parameterContainer,
)})",
default => $platform->quoteIdentifier($joinName),
default => $platform->quoteIdentifier($joinName),
};

$joinSpecArgArray[$j] = [
Expand Down Expand Up @@ -620,8 +620,8 @@
{
$count = count($values);
$format = $parameterSpecification[$count] ?? throw Exception\RuntimeException::forUnsupportedParameterCountOf(
$count,
);
$count,
);

return vsprintf($format, $this->flattenParameterList($values));
}
Expand Down
6 changes: 3 additions & 3 deletions src/Sql/Ddl/AlterTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ protected function processTableOptions(PlatformInterface $adapterPlatform): ?arr
$key = strtoupper($key);
$value = match (true) {
$value instanceof Literal => $value->getLiteral(),
is_bool($value) => $value ? '1' : '0',
is_int($value) => (string) $value,
default => $adapterPlatform->quoteTrustedValue($value),
is_bool($value) => $value ? '1' : '0',
is_int($value) => (string) $value,
default => $adapterPlatform->quoteTrustedValue($value),
};
$sqls[] = "{$key} = {$value}";
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sql/Ddl/Column/AbstractPrecisionColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected function getLengthExpression(): string
return match (true) {
null === $this->decimal => (string) $this->length,
null === $this->length => throw InvalidArgumentException::forMissingDecimalDigits($this->name, $this->type),
default => "{$this->length},{$this->decimal}",
default => "{$this->length},{$this->decimal}",
};
}
}
6 changes: 3 additions & 3 deletions src/Sql/Ddl/CreateTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ protected function processTableOptions(PlatformInterface $adapterPlatform): ?arr
$key = strtoupper($key);
$value = match (true) {
$value instanceof Literal => $value->getLiteral(),
is_bool($value) => $value ? '1' : '0',
is_int($value) => (string) $value,
default => $adapterPlatform->quoteTrustedValue($value),
is_bool($value) => $value ? '1' : '0',
is_int($value) => (string) $value,
default => $adapterPlatform->quoteTrustedValue($value),
};
$parts[] = "{$key} = {$value}";
}
Expand Down
6 changes: 3 additions & 3 deletions src/Sql/Expression.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ public function setParameters(

foreach ($parameters as $parameter) {
$this->parameters[] = match (true) {
is_array($parameter) => new Values($parameter),
is_array($parameter) => new Values($parameter),
$parameter instanceof ExpressionInterface => new SelectArgument($parameter),
$parameter instanceof ArgumentInterface => $parameter,
default => new Value($parameter),
$parameter instanceof ArgumentInterface => $parameter,
default => new Value($parameter),
};
}

Expand Down
4 changes: 2 additions & 2 deletions src/Sql/IdentifierPiece.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public static function of(string $piece, ?self $previous, bool $spaced, Platform
1 === preg_match(self::OPERATOR, $piece)
|| (! $isName && 1 === preg_match(self::EXPRESSION_CHARACTERS, $piece))
=> self::Unquotable,
$isName => self::Name,
default => self::Whole,
$isName => self::Name,
default => self::Whole,
};
}
}
Loading
Loading