diff --git a/analyzer-baseline.toml b/analyzer-baseline.toml index 076235f9..01d9232a 100644 --- a/analyzer-baseline.toml +++ b/analyzer-baseline.toml @@ -1782,12 +1782,6 @@ code = "possibly-invalid-argument" message = 'Possible argument type mismatch for argument #1 of `PhpDb\Adapter\Platform\PlatformInterface::quoteIdentifier`: expected `string`, but possibly received `non-empty-array|null|string`.' count = 1 -[[issues]] -file = "src/Sql/AbstractSql.php" -code = "possibly-invalid-argument" -message = 'Possible argument type mismatch for argument #1 of `PhpDb\Adapter\Platform\PlatformInterface::quoteValue`: expected `string`, but possibly received `bool|int|string`.' -count = 1 - [[issues]] file = "src/Sql/AbstractSql.php" code = "possibly-invalid-argument" @@ -3060,12 +3054,6 @@ code = "possibly-invalid-argument" message = 'Possible argument type mismatch for argument #1 of `PhpDb\Adapter\Platform\PlatformInterface::quoteIdentifier`: expected `string`, but possibly received `PhpDb\Sql\ExpressionInterface|string`.' count = 1 -[[issues]] -file = "src/Sql/Select.php" -code = "possibly-invalid-argument" -message = 'Possible argument type mismatch for argument #1 of `PhpDb\Adapter\Platform\PlatformInterface::quoteValue`: expected `string`, but possibly received `int|string`.' -count = 2 - [[issues]] file = "src/Sql/Select.php" code = "possibly-invalid-argument" diff --git a/src/Sql/AbstractSql.php b/src/Sql/AbstractSql.php index abd5cc0d..07b7a489 100644 --- a/src/Sql/AbstractSql.php +++ b/src/Sql/AbstractSql.php @@ -459,7 +459,7 @@ protected function resolveColumnValue( return $isIdentifier ? $fromTable . $platform->quoteIdentifierInFragment($column) - : $platform->quoteValue($column); + : $platform->quoteValue((string) $column); } protected function resolveTable( diff --git a/src/Sql/Select.php b/src/Sql/Select.php index 58cfdfa0..7f551cf1 100644 --- a/src/Sql/Select.php +++ b/src/Sql/Select.php @@ -555,7 +555,7 @@ protected function processLimit( return [$driver->formatParameterName("{$paramPrefix}limit")]; } - return [$platform->quoteValue($this->limit)]; + return [$platform->quoteValue((string) $this->limit)]; } /** @return array{0: string}|null */ @@ -574,7 +574,7 @@ protected function processOffset( return [$driver->formatParameterName("{$paramPrefix}offset")]; } - return [$platform->quoteValue($this->offset)]; + return [$platform->quoteValue((string) $this->offset)]; } /** @return array{0: list>}|null */ diff --git a/test/unit/TestAsset/TrustingSql92Platform.php b/test/unit/TestAsset/TrustingSql92Platform.php index 81b82d6f..28e99fcd 100644 --- a/test/unit/TestAsset/TrustingSql92Platform.php +++ b/test/unit/TestAsset/TrustingSql92Platform.php @@ -13,7 +13,7 @@ final class TrustingSql92Platform extends Sql92 * {@inheritDoc} */ #[Override] - public function quoteValue($value): string + public function quoteValue(string $value): string { return $this->quoteTrustedValue($value); }