[TASK] Provide forward-compatible CompositeExpression/ExpressionBuilder
doctrine/dbal changed their API and usage for CompositeExpression and ExpressionBuilder with 4.0, which they already deprecated in 3.x. To avoid a big drift over time core has to follow these changes in the provided facade implementations, but keep the core promises up. Furthermore this paves the way to be able to raise doctrine/dbal:^4.0 later without being breaking. At least this is one preparation for this goal, not the last. To give extension developers the ability to support their extensions for two core versions without doing dirty hacks to avoid deprecation messages spammed into the logs, this patch provides the new methods as a forward-compatible backport change. Core usages and the finally deprecation will be done in dedicated follow up patches for the main branch. This patch provides following new methods: * static 'CompositeExpression::and()' and 'or()' as drop-in replacement for 'new CompositeExpress( $type , array $parts)', where $type is 'and' or 'or' * 'ExpressionBuilder::and()' as drop-in replacement for 'andX()' * 'ExpressionBuilder::or()' as drop-in replacement for 'orX()' Argument types of the new methods will be made strict with the following deprecation patch as union types are not supported by all required PHP versions for v11.5. Resolves: #97081 Releases: main, 11.5 Change-Id: Ia3db19afe0d6e4375f92080ea278b7ab6d96a3a2 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73766 Tested-by:core-ci <typo3@b13.com> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch>
Showing
- typo3/sysext/core/Classes/Database/Query/Expression/CompositeExpression.php 123 additions, 13 deletions...Classes/Database/Query/Expression/CompositeExpression.php
- typo3/sysext/core/Classes/Database/Query/Expression/ExpressionBuilder.php 28 additions, 2 deletions...e/Classes/Database/Query/Expression/ExpressionBuilder.php
- typo3/sysext/core/Tests/Unit/Database/Query/Restriction/AbstractRestrictionContainerTest.php 1 addition, 1 deletion...se/Query/Restriction/AbstractRestrictionContainerTest.php
Please register or sign in to comment