Skip to content
Snippets Groups Projects
Commit e4d5450a authored by Alexander Schnitzler's avatar Alexander Schnitzler Committed by Christian Kuhn
Browse files

[BUGFIX] Fix method signature of Query::logicalOr()

The method signature of Query::locicalOr() is very misleading
because it only states there is one method argument $constraint1.

Actually, the method does accept any number of arguments, evaluated
via func_get_args(). It also accepts any number of arguments if
$constraint1 is an array of constraints. This leads to multiple
issues when working with phpstan and also when simply using an IDE
which does not understand the internal magic.

The goal is to state, that logicalOr() needs at least two
constraints but also accepts any number of further constraints.

Since that requires a breaking change, the method signature can
only be fixed partly for now. $constraint1 remains as is, a 2nd
argument $constraint2 is introduced, null by default to make it
optional and a variadic argument ...$furtherConstraints is also
introduced.

This approach keeps the bc promise but also lays the foundation
for further changes in the next version.

Releases: master, 10.4
Resolves: #95938
Change-Id: I2a605cb4f42ec5324d973b63cf838278287de516
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72135


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 065be835
No related merge requests found
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