Skip to content

Support AsDoctrineListener #255

@ruudk

Description

@ruudk

I have a Doctrine listener that is being detected as dead code.

#[AsDoctrineListener(event: 'postGenerateSchema')]
final readonly class FixDoctrineMigrationTableSchema
{
    public function __construct(
        #[Autowire(service: 'doctrine.migrations.dependency_factory')]
        private DependencyFactory $dependencyFactory,
    ) {}

    /**
     * @throws SchemaException
     * @throws Exception
     */
    public function postGenerateSchema(GenerateSchemaEventArgs $args) : void
    {

Or

#[AutoconfigureTag(name: 'doctrine.event_listener', attributes: [
    'event' => 'postGenerateSchema',
])]
final readonly class FixDoctrineMigrationTableSchema
{
    public function __construct(
        #[Autowire(service: 'doctrine.migrations.dependency_factory')]
        private DependencyFactory $dependencyFactory,
    ) {}

    /**
     * @throws SchemaException
     * @throws Exception
     */
    public function postGenerateSchema(GenerateSchemaEventArgs $args) : void
    {

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