Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Deprecation when using @ParamConverter and Type Hints since Symfony 3.4 #24891

Closed
@iluuu1994

Description

@iluuu1994
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.4.0-BETA3

I get the following deprecation message:

Relying on service auto-registration for type "MyEntity" is deprecated since version 3.4 and won't be supported in 4.0. Create a service named "MyEntity" instead.

This is my action:

/**
 * @Route("/my-entity/{id}")
 * @ParamConverter("myEntity", options={"id"="id"})
 */
public function editMyEntityAction(Request $request, MyEntity $myEntity)
{
    // ...
}

The deprecation goes away as soon as I remove the MyEntity type hint. It looks like Symfony thinks I'm trying to inject a MyEntity service. Is this a bug or am I doing something wrong?

Thanks!

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