Repository navigation
refactor(support): share the stored-reference uuid readings of the dossier, merge, deadline and term services - #5888
Merged
Conversation
… and the objection hook Assisted-by: ClaudeCode:claude-opus-5-5
…er compiler and the objection hook DossierCompiler and BezwaarCreationHook carried the same private extractUuid(): a trimmed string, or the first of id, uuid, @self.uuid, case and target that holds a string. That reading is now Support\DossierReferenceUuid::from(); both copies keep their name and delegate. Assisted-by: ClaudeCode:claude-opus-5-5
…he term and deadline listeners Assisted-by: ClaudeCode:claude-opus-5-5
…ossier references CaseMergeStore::referencedId() and the referenced() of the deadline, statutory-term and term-clock listeners carried the same reading: a trimmed string, or a row's id as a string. The helper becomes Support\ReferencedUuid with one dispatch and two row readings, inDossierReference() and inReference(); all six copies delegate. Assisted-by: ClaudeCode:claude-opus-5-5
rubenvdlinde
requested review from
WilcoLouwerse,
bbrands02 and
rjzondervan
as code owners
November 11, 2026 15:56
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.
What changed
Six classes carried one of two private readings of the uuid a stored reference names. Both trim a bare uuid string and answer an empty string for anything that is neither a string nor an array; they differ only in how they read a row:
id,uuid,@self.uuid,case,targetthat holds a stringDossierCompiler::extractUuid(),Bezwaar\BezwaarCreationHook::extractUuid()id, cast to a stringCases\CaseMergeStore::referencedId()(public), andreferenced()inListener\DeadlineCaseCreatedListener,Listener\OneStatutoryTermPerCaseListenerandListener\TermStatusClockListenerBoth are now
Service\Support\ReferencedUuid::inDossierReference()andinReference(), which share one dispatch (string, row, anything else) and differ only in the row reading. Each copy keeps its name, visibility and signature and delegates, so no caller changes, includingBezwaarCreationHook::linkRelatedCase()/onBezwaarCreated()(#5353) andDeadlineCaseCreatedListener::handle()(#4886).Support\ReferenceId::of()(#5866) andSupport\CaseRegisterReads::uuidOf()were not reused: they readidthenuuid, which is a third reading again.Characterisation tests
Committed before each change and green on the old code:
tests/Unit/Service/Support/DossierReferenceUuidCopiesTest.php: bothextractUuid()copies against 13 references, including a numeric or nullidthat is skipped, an emptyidthat is taken, and a nested@selfthat is not read. 26 cases.tests/Unit/Service/Support/ReferencedIdCopiesTest.php: the fourreferencedId()/referenced()copies against 8 references, including a numericidthat is cast and a loneuuidthat is not read. 32 cases.What ran
phpunit -c phpunit-unit.xmlon both tests, every unit test class that names one of the six classes orCaseMergeService, andtests/Unit/Architecture: 386 tests, all green but one inherited failure.phpcsandphpstan analyseon the touched files: no errors (the@specwarnings onCaseMergeStore's public methods were there before).Inherited:
ServiceCatchReturnsNullTest::testEveryAllowlistEntryNamesALiveSiteis red on development too (a stale allowlist entry forlib/Service/Settings/OpenRegisterBridge.php), untouched here.Duplication figures (duplicated 6-line windows, before -> after)
DossierCompiler<->BezwaarCreationHook: theextractUuid()windows, 8 -> 0 (theirtoArray()copies are handled by refactor(support): read results as rows through SearchesObjects in the dossier, objection, starter, workflow, relation, receipt and event readers #5886)DeadlineCaseCreatedListener<->TermStatusClockListener: 4 -> 0CaseMergeStore<->TermStatusClockListener: 2 -> 0Found after opening, from a full
phpmdrun: with this changeDeadlineCaseCreatedListenerreaches a coupling between objects of 13, one over the rule's limit (CouplingBetweenObjects, under 13).ReferencedUuidis the extra dependency. On development the class is under the limit. This needs a reviewer's call: accept the finding, or take one other dependency out of the class in a follow-up.AI-assisted: prepared with Claude Code (claude-opus-5-5); reviewed by a maintainer before merge.
Generated by Claude Code