Skip to content

refactor(objects): EmptyValueStripper and RenderedObjectUuids leave ObjectsController - #5846

Merged
rubenvdlinde merged 3 commits into
developmentfrom
sig/r2-ctl3-result-shape
Nov 6, 2026
Merged

rubenvdlinde merged 3 commits into
developmentfrom
sig/r2-ctl3-result-shape

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Needs #5842 first (gate 122 reads these units only from there on).

Two small classes take over what ObjectsController did by hand to a response. Every unit is at most 15 NLOC, McCabe 5 and 2 params.

  • Support\EmptyValueStripper replaces stripEmptyValues() (32 NLOC, McCabe 10). stripEmptyFromResults() delegates to it, and objects() no longer repeats that row strip inline.
  • Support\RenderedObjectUuids replaces the collection in collectNamesForResponse() (32, McCabe 13), collectUuidsFromArray() (18, McCabe 12, by-reference param) and isUuid(). collectNamesForResponse() keeps the cache lookup.

Two tests in tests/Unit/Service/Archival reached stripEmptyValues() by reflection. They now call EmptyValueStripper::stripped(), so they still drive the real rule.

Pinned by ObjectsControllerResponseValuesGoldenTest, 35 recorded cases plus a no-cache case, on the old code in the first commit. The fixture is unchanged afterwards. It keeps array keys, so a gap left by array_unique() or a stripped list item would show.

Capped mutants: 21 of 21 killed.

Params 3+ in the class: unchanged. The by-reference helper is gone.

Checks: every unit test file naming ObjectsController (950 tests) and tests/Unit/Service/Archival (280 tests) under pcov with --fail-on-risky, touched-file phpcs, phpmd, phpstan and psalm clean. Gate 122 ratchet against #5842: 0 findings in 16 changed units. Gate 119: 0.

AI-assisted (Claude Code).

The sequence in `<object?>` ended the PHP block for lizard, so gate 122
read none of the 74 units below counts(). Those units are measured from
here on.

Assisted-by: ClaudeCode:claude-opus-5-5
…ects uuids

Assisted-by: ClaudeCode:claude-opus-5-5
…bjectsController

stripEmptyValues(), the uuid collection of collectNamesForResponse() and
isUuid() move out, in units of 15 lines or fewer. objects() no longer
repeats the row strip of stripEmptyFromResults().

Assisted-by: ClaudeCode:claude-opus-5-5
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ c0be6b9

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ❌
psalm ❌
phpstan ❌
phpmetrics ✅
eslint ❌
stylelint ✅
build ✅
check-specs ✅
test-l10n ❌
test-l10n-parity ✅
format ✅
check-schema-l10n ✅
composer ✅ ✅ 165/165
npm ✅ ✅ 640/640
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌ 34140/34141 · 18 skipped
Newman ❌ 1628/1630
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ❌

Quality workflow — 2026-11-06 00:12 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde
rubenvdlinde merged commit 96f35c7 into development Nov 6, 2026
39 of 49 checks passed
@rubenvdlinde
rubenvdlinde deleted the sig/r2-ctl3-result-shape branch November 10, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant