Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rector removes empty name from @Route annotation #3234

Closed
stephanvierkant opened this issue Apr 23, 2020 · 1 comment · Fixed by #3248
Closed

Rector removes empty name from @Route annotation #3234

stephanvierkant opened this issue Apr 23, 2020 · 1 comment · Fixed by #3248
Labels

Comments

@stephanvierkant
Copy link
Contributor

stephanvierkant commented Apr 23, 2020

Bug Report

Subject Details
Rector version 0.7.17
Installed as composer dependency

In Symfony you can annotate a name and path in a Controller class, which is actually a prefix of controller actions in that class:

/**
 * @Route("front", name="front")
 */
final class FrontController extends Controller
{
    /**
     * @Route("/", name="")
     */
    public function homepage() : Response
    {
         //...
    }
}
attribute
>  bin/console debug:router
`  front                                   GET|POST            ANY      ANY    /front/`

Rector removes the empty name attribute, which means the route is removed.

Minimal PHP Code Causing Issue

https://getrector.org/demo/9dee6b7b-b443-4432-915b-5c22a80a4106#result

Expected Behaviour

An empty attribute is required in this case so it should be untouched.

@TomasVotruba
Copy link
Member

TomasVotruba commented Apr 23, 2020

Could you add failing test case to other routes?

How?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants