Question
Thanks for fixing my issues with the TemplateAnnotationRector before.
Now, I've found two more edge cases where I don't know if it is a case for Rector to solve it, so I just thought opening a Support Ticket:
In one case I've got a Controller which doesn't extend any class (no AbstractController or Controller). While the Template annotation works, the result ($this->render(...)) won't work, because the render method is a helper method from AbstractController (ControllerTrait to be more specific).
So I think the rector shouldn't do anything in this case or what do you think?
The other case is that some of our actions call another private method like in the following example:
/**
* @Route("/create", name="survey_create")
* @Template("PAPPSurveyBundle:Survey:create.html.twig")
*
* @return array
*/
public function createAction(Request $request, Party $currentParty)
{
$survey = $this->surveyHelper->createSurvey($currentParty);
return $this->processForm($request, $currentParty, $survey, $this->generateUrl('survey_save'));
}
private function processForm(Request $request, Party $party, Survey $survey, $url)
{
...
return [
'form' => $form->createView(),
];
}
In this case the Template annotation will be removed, but nothing more which breaks the application.
In both cases, I am not sure what the rector should do. If you want me to open issues for one or both of these cases, just let me know, I could add some failing tests.
Question
Thanks for fixing my issues with the TemplateAnnotationRector before.
Now, I've found two more edge cases where I don't know if it is a case for Rector to solve it, so I just thought opening a Support Ticket:
In one case I've got a Controller which doesn't extend any class (no AbstractController or Controller). While the Template annotation works, the result ($this->render(...)) won't work, because the render method is a helper method from AbstractController (ControllerTrait to be more specific).
So I think the rector shouldn't do anything in this case or what do you think?
The other case is that some of our actions call another private method like in the following example:
In this case the Template annotation will be removed, but nothing more which breaks the application.
In both cases, I am not sure what the rector should do. If you want me to open issues for one or both of these cases, just let me know, I could add some failing tests.