Repository navigation
refactor(architecture): publish the eight values ObjectServiceInterface names in lib/Contract (X00 b) - #10977
Merged
Merged
Conversation
…ce names in lib/Contract ObjectSaveOptions, BulkSaveOptions, LockRequest, UnlockRequest, ObjectFindOptions, ObjectDeletion, ObjectPatch and ObjectValidationVerdict move verbatim into lib/Contract (task 7.2); their properties and the ObjectFindTarget named constructor name the published classes. Each old Kernel\Contracts\Value name stays as a deprecated final subclass with nothing of its own. ObjectService::findPatchTarget() takes the published ObjectFindTarget, because ObjectPatch::$target now has that type. Assisted-by: ClaudeCode:claude-opus-5-5
This was referenced Nov 21, 2026
…#10977 Assisted-by: ClaudeCode:claude-opus-5-5
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Package X00, PR b of 3: the eight value types
ObjectServiceInterfacenames move intolib/ContractWave 5, round 1, task 7.2. Stacked on #10976 (PR a): the eight values name the five values PR a publishes, so this branch contains PR a's commit; review only the second commit (
959387d7). Land #10976 first.What moved and why
lib/Contract/<X>.phpforObjectSaveOptions,BulkSaveOptions,LockRequest,UnlockRequest,ObjectFindOptions,ObjectDeletion,ObjectPatch,ObjectValidationVerdict: class body verbatim (constructor, promoted readonly properties, methods, docblocks), no longerfinal. WithinOCA\OpenRegister\Contractthe type hints and the constructor defaults on other promoted types now resolve to the published classes (ObjectFindTarget,SavePolicy,SaveActor,BulkBatchDefaults,LockRunStep), so the published contract is self-contained: a leaf app that loadshydra-gates/contracts/can buildnew ObjectSaveOptions()without any Kernel class.ObjectPatchdropped its explicit import of the KernelObjectFindTargetfor that reason.lib/Contract/ObjectFindTarget.php(from PR a):fromFindOptions()now takes the publishedObjectFindOptions(a widening; the old name is a subclass).lib/Kernel/Contracts/Value/<X>.phpkeeps its name asfinal class X extends \OCA\OpenRegister\Contract\X {},@deprecatednaming the new class. Positional and named construction,instanceofand type hints on the old name keep working;ObjectValidationVerdictstaysJsonSerializablethrough its parent.vendor/bin/phpstan analyseoflib/after the move reports exactly one new call that passes a published value into an old-typed parameter:ObjectService::patchWithinScope()passesObjectPatch::$target(nowContract\ObjectFindTarget) to the privatefindPatchTarget(). That parameter is widened toContract\ObjectFindTarget(imported asPublishedObjectFindTarget, becauseObjectServicekeeps constructing the old name). It is in this PR rather than in PR c because without itpatchObject()with a default-built target would hit aTypeErrorat runtime. Nothing else inlib/changes.ContractIsALeafTest::PUBLISHEDlists the eight new files. No csv change:lib/Contract/counts to Kernel through its directory row.Behaviour: one difference by design, documented: a value built without an explicit nested value (for example
new Kernel\...\ObjectSaveOptions()) now holds a defaultContract\ObjectFindTarget/Contract\SavePolicy/Contract\SaveActor/Contract\BulkBatchDefaultsinstead of the old subclass. Same properties and values; every openregister parameter that receives one accepts the published type (phpstan clean), and the fleet check in PR c covers apps.Exposed lines per area (
measure()['exposed_loc'])c3d2067bExpected by the package: about +65 Kernel for the 13 stubs. Measured −99 Kernel so far: the moved code is named mostly by the Kernel stubs (same area); PR c, which types the published interface and
ObjectServiceagainst the new names, is where the published files become exposed. Core +1 is thePublishedObjectFindTargetimport inObjectService.References against the order
56 before, 56 after.
Newly exposed files / new Kernel files
modularity_check.py --checkreports:lib/Contract/{BulkBatchDefaults,BulkSaveOptions,LockRequest,LockRunStep,ObjectDeletion,ObjectFindOptions,ObjectFindTarget,ObjectPatch,ObjectSaveOptions,ObjectValidationVerdict,SaveActor,SavePolicy,UnlockRequest}.php: the published contract decided in task 7.2.lib/Contract/ObjectFindTarget.php, named byObjectService(Core) through the widenedfindPatchTarget()parameter: a value on the published contract's signature.Nothing else.
Gate 67
The companion PR in ConductionNL/.github (opened with PR c) carries all 13 files and the changed
ObjectServiceInterface.php, byte-identical. Not mergeable before that .github PR. Gate 67 is already red on main (see #10976).What ran
php -landvendor/bin/phpcson the 17 changed lib files andObjectService.php: clean.vendor/bin/phpstan analyse --no-progresson all oflib/, compared with the same run onorigin/main: 38 findings on both, identical lists (the one new finding the move caused,findPatchTarget, is fixed here).vendor/bin/psalm --no-cacheonlib/Contract/*.php, the 8 stubs andObjectService.php: no errors.python3 tools/sig/modularity_check.py --check: only the deliberate files above; no new reference against the order.tools/sig/deptrac.sh areas --check: no new pair from this change (the same 2 stale-baseline pairs as onorigin/main).vendor/bin/phpunit -c phpunit.xml --no-coverage tests/Unit/Architecture: OK (2371 tests, 8057 assertions).tests/Unit/Contract/PromotedValueTypesTest.php(all 13 types: old name is an instance of the new; equal values from equal named arguments; equal defaults; positional construction on the old name; inherited methods; the named constructor returns the class it is called on; published nested values accepted by the old names) +ContractIsALeafTest: OK (49 tests, 155 assertions).*Test.phpundertests/Unitthat names any of the 13 old names orService\ObjectService(645 files): 9228 tests, 4 errors, allAnonymousEnvelopeReadPathsTest, which fails identically onorigin/main.Order
.github companion PR → #10976 (a) → this PR (b) → PR c.
Written with Claude Code (claude-opus-5-5)
Generated by Claude Code