diff --git a/typo3/sysext/core/Classes/Database/Query/Expression/ExpressionBuilder.php b/typo3/sysext/core/Classes/Database/Query/Expression/ExpressionBuilder.php index 6621ed48739c874155598670a74ae35d0d1872ac..8eb7f64744126975ab5a8ca407c98b35a3ef479f 100644 --- a/typo3/sysext/core/Classes/Database/Query/Expression/ExpressionBuilder.php +++ b/typo3/sysext/core/Classes/Database/Query/Expression/ExpressionBuilder.php @@ -613,14 +613,11 @@ class ExpressionBuilder * Quotes a given input parameter. * * @param mixed $input The parameter to be quoted. - * @param string|int|null $type The type of the parameter. + * @param \PDO::PARAM_*|Connection::PARAM_*|int $type The type of the parameter. * @return mixed Often string, but also int or float or similar depending on $input and platform - * @todo: Change signature to literal($input, int $type = \PDO::PARAM_STR) as breaking change in v12. */ - public function literal($input, $type = \PDO::PARAM_STR) + public function literal($input, int $type = \PDO::PARAM_STR) { - // @todo: drop this line together with signature change in v12 - $type = $type ?? \PDO::PARAM_STR; return $this->connection->quote($input, $type); } diff --git a/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst b/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst index 48654010325f1cf1e4e82ff86c0f738aadaf27c6..e8eda04a5316060fe88c513a2ec8770812b39c90 100644 --- a/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst +++ b/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst @@ -206,6 +206,7 @@ The following PHP static class methods changed signature according to previous d The following PHP class methods changed signature according to previous deprecations in v11 and are now type hinted: +- :php:`\TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder->literal()` (second argument requires an integer) - :php:`\TYPO3\CMS\Core\Database\Query\QueryBuilder->quote()` (second argument requires an integer) - :php:`\TYPO3\CMS\Core\TimeTracker\TimeTracker->setTSlogMessage()` (second argument requires a string) - :php:`\TYPO3\CMS\Backend\Tree\View\AbstractTreeView->getIcon()` (first argument is now type hinted `array`) diff --git a/typo3/sysext/core/Tests/Unit/Database/Query/Expression/ExpressionBuilderTest.php b/typo3/sysext/core/Tests/Unit/Database/Query/Expression/ExpressionBuilderTest.php index f2a5bee529bddc5a953c2a9f7861e9ba71a78cf0..c5e0e4f3e2cc64f7cbacb4ea13b67650010f2237 100644 --- a/typo3/sysext/core/Tests/Unit/Database/Query/Expression/ExpressionBuilderTest.php +++ b/typo3/sysext/core/Tests/Unit/Database/Query/Expression/ExpressionBuilderTest.php @@ -777,10 +777,10 @@ class ExpressionBuilderTest extends UnitTestCase */ public function literalQuotesValue(): void { - $this->connectionProphecy->quote('aField', 'Doctrine\DBAL\Types\StringType') + $this->connectionProphecy->quote('aField', \PDO::PARAM_STR) ->shouldBeCalled() ->willReturn('"aField"'); - $result = $this->subject->literal('aField', 'Doctrine\DBAL\Types\StringType'); + $result = $this->subject->literal('aField'); self::assertSame('"aField"', $result); }