Skip to content

[v6] #279 - Make the classes marked @final since 5.4 final, type the services on the interfaces - #521

Merged
njoubert-cleverage merged 1 commit into
dev-v6from
279
Dec 2, 2026
Merged

njoubert-cleverage merged 1 commit into
dev-v6from
279

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #279 (v6.0 step; the v5 step was #295).

  • The 109 classes marked @final since 5.4 are final (121 final classes in src/); the @internal tags are unchanged.
  • The services of the bundle are typed on ProcessManagerInterface, ProcessConfigurationRegistryInterface and TransformerRegistryInterface (commands, ProcessExecutorTask, ProcessLauncherTask, ProcessManager, the Monolog processors, TransformerTask, TransformerTrait and the transformers using it), so that a decorator of these services is injected everywhere.
  • The interfaces declare the methods the services use: ProcessManagerInterface::getProcessHistory() / getTaskConfiguration(), ProcessConfigurationRegistryInterface::getProcessCodes(). Both extend ResetInterface: their services are tagged kernel.reset, and the tag moves to a decorator, which must delegate reset().
  • PregFilterTransformer::transform() returns ?string (the @phpstan-ignore return.unusedType is removed).
  • ContextualOptionResolver has no interface: documented as not decoratable.
  • Changes made by Rector on the now-final classes: final removed from the class constants, CsvWriterTask::getHeaders() returns array, the unused $length parameter of SplFile::readLine() is removed.

Tests: no PHPUnit double nor subclass of a final class is left (doubles on the interfaces, real ProcessState); CleverAgeProcessBundleTest::testSubclassLoadsTheServicesOfTheBundle is removed, TransformerRegistryTest::testOnlyTheTransformersOfTheLocatorAreGiven is rewritten without a subclass. DecorationTest decorates the process manager and the registries in a decorated environment of the test kernel: the decorators are used, lint:container checks every service against them, and the reset goes through them.

Follow-ups in the bridges, for their test doubles of ProcessState before they allow ^6.0: cleverage/doctrine-process-bundle#96, cleverage/flysystem-process-bundle#99, cleverage/archive-process-bundle#82.

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

Major (v6.0, see UPGRADE.md, section "Final classes"):

  • extending one of the 109 classes, or creating a PHPUnit double of one of them, is no longer possible;
  • ProcessManagerInterface and ProcessConfigurationRegistryInterface declare new methods and extend ResetInterface: own implementations and decorators must implement them;
  • the $transformerRegistry property of TransformerTrait is typed ?TransformerRegistryInterface;
  • PregFilterTransformer::transform() returns ?string, SplFile::readLine() has no $length parameter.

🤖 Generated with Claude Code

…ces on the interfaces

The 109 classes marked @Final since 5.4 are final. The services of the bundle
are typed on ProcessManagerInterface, ProcessConfigurationRegistryInterface and
TransformerRegistryInterface, so that a decorator is injected everywhere; the
interfaces declare the methods the services use and the two services tagged
kernel.reset extend ResetInterface. PregFilterTransformer::transform() returns
?string. Update documentation and tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage requested a review from a team as a code owner December 2, 2026 15:29
@njoubert-cleverage
njoubert-cleverage merged commit 3629e6c into dev-v6 Dec 2, 2026
15 checks passed
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