Skip to content

Define the public API: mark classes @final or @internal #56

Closed

Description

@njoubert-cleverage

Description

No class of the bundle is final, @final or @internal (except the #[As…] attributes): the whole code base is an extension point, so any refactoring (constructor change, renamed protected method) is potentially a breaking change.

process-bundle did it in cleverage/process-bundle#279: @final since 5.4 on the classes not meant to be extended, @internal on the infrastructure classes (extension, compiler passes, commands, listeners). The Symfony DebugClassLoader then triggers a deprecation for the classes extending a @final one, giving one minor version of notice.

Proposed fix

  • 2.3: add @final since 2.3 and @internal annotations.
  • 3.0: turn @final into final.

Proposed scope, to be discussed in the PR:

Kind Classes Proposal
Infrastructure CleverAgeCacheProcessExtension, RegisterAdaptersPass @internal
Tasks GetTask, SetTask @final (AbstractCacheTask stays open)
Registry AdapterRegistry @final
Adapter Adapter stays open: extended by the applications (docs/reference/adapter.md)
Exception, bundle class MissingAdapterException, CleverAgeCacheProcessBundle @final

Found during the Symfony bundle best practices review of the bridges.

Requirements

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

Breaking changes

None in 2.3 (annotations only, extending a @final class triggers a deprecation). Major (3.0): extending a class that becomes final, or using an @internal class, is no longer supported.

Activity

  1. added 2 commits that reference this issue on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions