Skip to content

refactor(procest): $termijnService -> $deadlineService - #809

Open
rubenvdlinde wants to merge 1 commit into
feat/english-vocabulary-deadline-corefrom
feat/english-vocabulary-deadline-params
Open

refactor(procest): $termijnService -> $deadlineService#809
rubenvdlinde wants to merge 1 commit into
feat/english-vocabulary-deadline-corefrom
feat/english-vocabulary-deadline-params

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

What

Renames the injected dependency's property/parameter name across 15 files, so it matches the DeadlineService type it has held since #808. Includes DeadlineController's shorter $termijn, which is the same dependency under a different name.

Stacked on #808. Merge order: #797#803#804#806#807#808 → this.

The mistake this commit made first, because it generalises

Renaming a promoted constructor property needs two patterns, not one:

$termijnService          the parameter / promoted declaration
$this->termijnService    every access

A search for $termijnService finds only the first. In a property access the $ sigil belongs to $this, not to the member name — so ->termijnService is a different token and doesn't match.

The first pass renamed all 15 declarations and none of the 47 accesses, leaving every class calling a property that no longer existed.

That isn't a subtle failure — phpunit went from 1777 passing to 20 errors and 3 failures immediately. But it's only loud because a suite covers this code. The same edit in a thinly-tested file would have produced a property-access error on a path nobody runs.

The residual grep at the end of this commit therefore matches the bare word termijnService, with no sigil, so it cannot miss either spelling.

What was deliberately left

Two bare $termijn variables remain and are not this dependency:

file what it actually holds
SubsidieController an int of weeks, from $body['termijnWeken']
BeschikkingService the array returned by $this->bezwaarScheduler->computeTermijn()

Both are "termijn" as a period — a different concept from the service. Renaming them belongs with computeTermijn()/termijnWeken, not here. They were read before being skipped, not assumed.

Verification

  • php -l clean on all 15 files
  • phpunit, whole unit suite: 1777 tests, 6160 assertions, 5 skipped — green, and identical to the pre-change baseline on both counts
  • Every touched lib/ file is phpcs CLEAN
  • Residual grep for termijnService (unsigilled) across lib/ and tests/ — none

Renames the injected dependency's property/parameter name across 15 files, so
it matches the DeadlineService type it has held since #808. Includes
DeadlineController's shorter `$termijn`, which is the same dependency under a
different name.

Stacked on feat/english-vocabulary-deadline-core (#808). Merge order:
797 -> 803 -> 804 -> 806 -> 807 -> 808 -> this.

THE MISTAKE THIS COMMIT MADE FIRST, BECAUSE IT GENERALISES. Renaming a promoted
constructor property needs TWO patterns, not one:

    $termijnService        the parameter / promoted declaration
    $this->termijnService  every access

A search for `$termijnService` finds only the first. In a property access the
`$` sigil belongs to `$this`, not to the member name, so `->termijnService` is a
different token and does not match. The first pass renamed all 15 declarations
and none of the 47 accesses, leaving every class calling a property that no
longer existed.

That is not a subtle failure — phpunit went from 1777 passing to 20 errors and 3
failures immediately — but it is only loud because a suite covers this code.
The same edit in a thinly-tested file would have produced a property-access
error on a path nobody runs. The residual grep at the end of this commit
therefore matches the bare word `termijnService`, with no sigil, so it cannot
miss either spelling.

WHAT WAS DELIBERATELY LEFT. Two bare `$termijn` variables remain and are NOT
this dependency:

  - SubsidieController: an int of weeks, from $body['termijnWeken'].
  - BeschikkingService: the array returned by
    $this->bezwaarScheduler->computeTermijn().

Both are "termijn" as a PERIOD, a different concept from the service, and
renaming them belongs with computeTermijn()/termijnWeken rather than here. They
were read before being skipped, not assumed.

VERIFIED
  - php -l clean on all 15 files.
  - phpunit, whole unit suite: 1777 tests, 6160 assertions, 5 skipped — green,
    and identical to the pre-change baseline on both counts.
  - Every touched lib/ file is phpcs CLEAN.
  - Residual grep for `termijnService` (unsigilled) across lib/ and tests/:
    none.
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