ZF-11472: "zf create action" can cause malformed PHP when other action methods already exist
Description
When controller contains some non-empty methods, e.g.:
public function editAction()
{
if ($obj === null) {
...
} else {
...
}
}
then command:
{{zf create action lorem}}
eats closing braces. editAction() method will be converted to
public function editAction()
{
if ($obj === null) {
...
} else {
...
}
(without ending brace).
This is annoying if you have large number of action methods.
Comments
Posted by Kim Blomqvist (kblomqvist) on 2011-06-13T10:01:56.000+0000
Add code tags
Posted by Włodzimierz Gajda (gajdaw) on 2011-06-13T16:47:53.000+0000
Thanks.
Posted by Adam Lundrigan (adamlundrigan) on 2011-06-14T00:57:25.000+0000
Reproduced successfully against trunk 1. {{zf create controller Foo}} 2. {{zf create action testOne Foo}} 3. Edit FooController, change testOneAction to:
The controller will now look like this:
Posted by Adam Lundrigan (adamlundrigan) on 2011-10-17T14:55:00.000+0000
Reproducing test case:
Result:
Working on a fix now.
Posted by Adam Lundrigan (adamlundrigan) on 2011-10-17T15:37:10.000+0000
This is actually an issue with {{Zend_Reflection_Method}} which was reported in ZF-9018
Posted by Adam Lundrigan (adamlundrigan) on 2011-10-17T15:38:43.000+0000
Duplicate of ZF-9501