Circular reference: modeler_api.service injects @router.no_access_checks eagerly, not as a service closure
## Problem `modeler_api.service` (`Drupal\modeler_api\Api`) injects most heavy dependencies lazily via `!service_closure` (entity_type.manager, router.route_provider, token, ...), to avoid container circular references (see the closed #3537810, #3576308, #3562825, #3563148, #3556048). But one router dependency is still injected **eagerly**: ```yaml modeler_api.service: arguments: # ... - '@router.no_access_checks' # eager, not a service closure - !service_closure '@entity_type.manager' - !service_closure '@router.route_provider' ``` On a site where another module exposes a param converter that transitively reaches `date.formatter`, this closes a container cycle. For example with openagenda (openagenda.event_converter -> openagenda.event_processor -> date.formatter): ``` date.formatter -> Drupal\modeler_api\Hook\EntityHooks -> modeler_api.service -> router.no_access_checks -> route_enhancer.param_conversion -> paramconverter_manager -> openagenda.event_converter -> openagenda.event_processor -> date.formatter ``` The container then fails to compile (ServiceCircularReferenceException for `date.formatter`), so the whole site and drush cannot bootstrap once modeler_api is enabled alongside such a module. It only appears in combination, which is why modeler_api alone does not trip it. ## Steps to reproduce 1. Install modeler_api 1.1.3 plus a module whose param converter transitively depends on `date.formatter` (openagenda 4.0.0-alpha4 reproduces it). 2. `drush cr`. 3. The container fails to compile with the circular reference above. ## Proposed fix Inject the router as a `!service_closure` like its siblings, and resolve it lazily, mirroring the existing `getRouteProvider()`. `Api` uses the router in exactly one place (`->match()`), so the change is minimal: `modeler_api.services.yml`: ```yaml - !service_closure '@router.no_access_checks' ``` `Api.php`: change the constructor parameter to `protected \Closure $routerFactory`, add a `getRouter()` accessor like `getRouteProvider()`, and call `$this->getRouter()->match(...)` at the single call site. This breaks the compile-time edge with no behavior change. Happy to open an MR. Environment: modeler_api 1.1.3, Drupal 11.3, PHP 8.4.
issue