Skip to content

doc: describe the types listed by Symfony's debug:autowiring command - #8633

Merged
soyuka merged 1 commit into
api-platform:5.0from
nicolas-grekas:debug-autowiring-hints
Oct 5, 2026
Merged

soyuka merged 1 commit into
api-platform:5.0from
nicolas-grekas:debug-autowiring-hints

Conversation

@nicolas-grekas

Copy link
Copy Markdown
Contributor

Symfony's debug:autowiring command displays the first line of the docblock of each autowirable type, as a hint about what the service is for. This PR adds or improves that line for the types this package registers for autowiring.

Same as symfony/symfony#66566, which does it for Symfony's own types.

@nicolas-grekas
nicolas-grekas force-pushed the debug-autowiring-hints branch from 861829a to 3b77002 Compare October 3, 2026 07:35
@nicolas-grekas nicolas-grekas changed the title docs: describe the types listed by Symfony's debug:autowiring command doc: describe the types listed by Symfony's debug:autowiring command Oct 3, 2026
@nicolas-grekas

nicolas-grekas commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor Author

I dropped the hints I had added on PersistProcessor, RemoveProcessor and the UUID/ULID filters: these final classes are aliased by their FQCN, so debug:autowiring lists them as types to autowire. Type-hinting one breaks as soon as the service is decorated (TypeError, only lint:container catches it).

WDYT of deprecating the FQCN aliases of final classes that implement an interface, in favor of named aliases on the interface? Eg $container->registerAliasForArgument('api_platform.doctrine.orm.state.persist_processor', ProcessorInterface::class, 'persist') in the extension would let apps write:

public function __construct(
    #[Target('persist')] private ProcessorInterface $processor,
) {
}

debug:autowiring would then list the processors as variants of ProcessorInterface. That's what symfony/symfony#66568 does for Symfony's webhook parsers. The filter aliases point to abstract definitions and can't be autowired at all; symfony/symfony#66569 hides them from the listing.

@soyuka
soyuka merged commit 5cd0a87 into api-platform:5.0 Oct 5, 2026
117 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.

2 participants