Commit cda3d9f5 authored by crell's avatar crell Committed by Stefan Bürk
Browse files

[BUGFIX] Correct bad doc type in QueryObjectModelFactory

The docblock for QueryObjectModelFactory::comparison() expects
a string, specifically one of the QueryObjectModelConstants.JCR_OPERATOR_*
constants.  However, that class seems to no longer exist,
and what it actually uses is an integer. (Passing a string through
would break in subsequent sub-calls.)

This corrects the type to the correct integer constants that
are actually used in practice, and uses a language type
to ensure it is used properly.

Used command:

> ./Build/Scripts/runTests.sh -s phpstanGenerateBaseline

Resolves: #98007
Releases: main, 11.5
Change-Id: Id00e30370a1944a3158cb46825ccc4e15174f7ab
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75269

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
parent c59cd7c4
......@@ -1945,11 +1945,6 @@ parameters:
count: 1
path: ../../typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php
-
message: "#^Parameter \\#2 \\$operator of method TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\Qom\\\\QueryObjectModelFactory\\:\\:comparison\\(\\) expects string, int given\\.$#"
count: 9
path: ../../typo3/sysext/extbase/Classes/Persistence/Generic/Query.php
-
message: "#^Parameter \\#3 \\$operand2 of method TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\Qom\\\\QueryObjectModelFactory\\:\\:comparison\\(\\) expects TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\Qom\\\\StaticOperandInterface, string given\\.$#"
count: 1
......
......@@ -124,12 +124,12 @@ class QueryObjectModelFactory implements SingletonInterface
* Filters node-tuples based on the outcome of a binary operation.
*
* @param PropertyValueInterface $operand1 the first operand; non-null
* @param string $operator the operator; one of QueryObjectModelConstants.JCR_OPERATOR_*
* @param QueryInterface::OPERATOR_* $operator the operator
* @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\StaticOperandInterface $operand2 the second operand; non-null
* @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface the constraint; non-null
* @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\RepositoryException if the operation otherwise fails
*/
public function comparison(PropertyValueInterface $operand1, $operator, $operand2)
public function comparison(PropertyValueInterface $operand1, int $operator, $operand2)
{
return GeneralUtility::makeInstance(Comparison::class, $operand1, $operator, $operand2);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment