Skip to content

Use AbstractBundle and PHP service definitions #277

Open

Description

@njoubert-cleverage

Description

The bundle uses the Bundle + Extension + Configuration triplet: CleverAgeProcessBundle, CleverAgeProcessExtension, Configuration, and service definitions in YAML (config/services/*.yaml).

Since Symfony 6.1 (the bundle requires ^6.4), the recommended way is a single AbstractBundle class:

  • configure(DefinitionConfigurator): configuration tree (current Configuration);
  • loadExtension(array, ContainerConfigurator, ContainerBuilder): service loading, registry arguments, generic_transformers definitions (current CleverAgeProcessExtension::load());
  • build(): compiler passes (unchanged).

The best practices for reusable bundles also recommend PHP over YAML for the bundle service definitions (config/services.php or config/services/*.php): faster to load, checked by static analysis, no need of the YAML loader.

Proposed fix

Bridge bundles

The bridge bundles use the same Bundle + Extension + Configuration triplet and YAML service definitions (config/services/*.yaml), so they must be converted the same way (AbstractBundle, PHP service definitions, same service ids), one ticket/PR per bundle once this one is done:

Their configuration root is handled with their own rename (cleverage_<x>_process); the removal of their Extension/Configuration classes is a breaking change for each bridge (next major).

Requirements

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

Breaking changes

  • Major: CleverAgeProcessExtension and Configuration are removed (code extending or instantiating them, e.g. new Configuration() in tests, must be updated).
  • None for applications: same configuration tree (unless Rename config root to "cleverage_process" #111 is done at the same time), same service ids.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions