ZF-9502: Zend_Tool breaks existing code when creating a new action in the existing controller.


I use Zend_Tool from the command line (Windows) to create action in the existing controller, but it has added tabs and spaces, and this time it has removed one line where there was a closing brace...

Usually I have to clean up after him (Zend_Tool), he is such a naughty, :-).


Simple way to reproduce this bug:

zf create controller test

Open TestController in your editor and add "if" to index action: <?php

class TestController extends Zend_Controller_Action { public function indexAction() { if ($a) {



Then create new action:

zf create action foobar Test

After that controller's code will be broken:

public function indexAction()
    if ($a) {       // <- closing brace is removed

public function foobarAction()
    // action body

Bug confirmed, i just ranned into it.

Not only it wipes the closing } of an if-construction, but it also indents the code with two tabs (or 8 spaces).

Duplicates of the ZF-9501.

Removing fix version. Issues marked 'duplicate' don't need a fix version -- it makes them appear in the JIRA changelog and/or roadmap.