Skip to content

[symfony 7.3] Public constructor required in custom filter #6970

@BaptisteChabrol

Description

@BaptisteChabrol

Describe the bug
When creating a custom filter, I have the error :

Invalid service "App\Foo": its constructor must be public. Did you miss configuring a factory or a static constructor? Try using the "#[Autoconfigure(constructor: ...)]" attribute for the latter.

To Reproduce
Create a custom filter using the FilterTrait like in the documentation.

(OPTIONAL) Additional context
It's maybe due to the symfony 7.3 version since this PR

Changing FilterTrait private constructor to public resolve the issue for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions