Repository navigation
[Improvement] Add useInheritedProperties() to the service resolver contracts - #166
Merged
Merged
Conversation
…ntracts Pimcore 2026.4 adds Element\Service::useInheritedProperties() (pimcore/pimcore#19632), and the contract tests require every public static method of the services in the resolver contracts, so they fail against 2026.x-dev. The contracts toggle AbstractElement's flag the same way, which also works with Pimcore 2026.1 to 2026.3. Added to the @internal resolver interfaces, not yet to the public contract interfaces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd require Pimcore 2026.4 Like the other contract methods, call Service::useInheritedProperties() instead of toggling the flag here. The method exists from Pimcore 2026.4 on, so the bundle now requires pimcore/pimcore ^2026.4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open
3 tasks
|
There was a problem hiding this comment.
🟡 Changes recommended
The new test file is missing the POCL copyright/license header, which must be added manually because the fixer scans only src.
1 open issue
What changed in this PR
Updates the static resolver bundle to expose Pimcore 2026.4’s useInheritedProperties() helper across element, asset, document, and data object services, addressing the reported contract-test failures.
Changes:
- Adds forwarding methods and internal interface declarations while leaving public contract interfaces unchanged.
- Raises the minimum Pimcore dependency to
^2026.4and documents the upgrade. - Adds regression tests for callback arguments, return values, and restoration of the inheritance setting after success or exceptions.
Tests were not executed during this review.
| File | Description |
|---|---|
tests/Unit/Models/Element/UseInheritedPropertiesTest.php |
Tests callback behavior and setting restoration across all four contracts. |
src/Models/Element/ServiceResolverInterface.php |
Declares the helper on the internal element interface. |
src/Models/Document/DocumentServiceResolverInterface.php |
Declares the helper on the internal document interface. |
src/Models/DataObject/DataObjectServiceResolverInterface.php |
Declares the helper on the internal data object interface. |
src/Models/Asset/AssetServiceResolverInterface.php |
Declares the helper on the internal asset interface. |
src/Contract/Models/Element/ServiceResolverContract.php |
Forwards the helper to the core element service. |
src/Contract/Models/Document/DocumentServiceResolverContract.php |
Forwards the helper to the core document service. |
src/Contract/Models/DataObject/DataObjectServiceResolverContract.php |
Forwards the helper to the core data object service. |
src/Contract/Models/Asset/AssetServiceResolverContract.php |
Forwards the helper to the core asset service. |
doc/02_Upgrade_Notes/README.md |
Documents the dependency requirement and public-interface exclusion. |
composer.json |
Requires Pimcore ^2026.4. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Changes in this pull request
Related: pimcore/pimcore#19632
pimcore/pimcore#19632 (merged into
2026.x, Pimcore 2026.4) addsPimcore\Model\Element\Service::useInheritedProperties(). The contract tests require every public static method of the services in the resolver contracts, soServiceResolverTest,AssetServiceResolverTest,DocumentServiceResolverTestandDataObjectServiceResolverTestfail in every CI leg that installspimcore/pimcore2026.x-dev(seen on #165).useInheritedProperties(bool $inheritProperties, callable $fn, array $fnArgs = []): mixedin the element, asset, document and data object service resolver contracts. Like the other contract methods it calls the core service (Service::useInheritedProperties()).composer.json:pimcore/pimcore^2026.1→^2026.4, because that method only exists from Pimcore 2026.4 on. Withminimum-stability: devthis resolves to2026.x-dev(2026.4.x-dev) until 2026.4.0 is released.@internalresolver interfaces (ServiceResolverInterface,AssetServiceResolverInterface,DocumentServiceResolverInterface,DataObjectServiceResolverInterface), so the resolver services offer it.*ServiceResolverContractInterfaceinterfaces, on purpose: a new method on a non-internal interface breaks other implementations of it. That is tracked for 2027.1 in [Dev tooling] Fix PHPStan 2.3 findings that need a BC break (2027.1) platform-version#761.Additional info
Regression test: the four contract tests against
pimcore/pimcore2026.x-dev: 4 failures before, all OK after. NewUseInheritedPropertiesTest: the callable runs with the given setting and the previous one is restored, also when the callable throws (all four contracts).Verified locally (PHP 8.4) with the highest and with the lowest dependencies: full Unit suite (122 tests) and PHPStan green.
After merging, #165 needs its branch updated to pick this up.
🤖 Generated with Claude Code