ZF-11703: Zend tool can't manage controllers with phpdoc
Description
I think there's bug in creating new action in controller with class php doc. Zend tools mangles controller code.
For example, i have class:
<?php
/**
* For manipulating files.
*
* @author Karol Ciba
*/
class Admin_FileController extends Zend_Controller_Action
{
public function init()
{
}
public function indexAction()
{
// action body
}
}
when i try to create new action with: zf create action list file 1 admin, then controller class looks like this:
/**
* For manipulating files.
*
* @author Karol Ciba
*
*/
/**
* For manipulating files.
*
* @author Karol Ciba
*
*/
class Admin_FileController extends Zend_Controller_Action
{
public function init()
{
}
public function indexAction()
{
// action body
}
public function listAction()
{
// action body
}
}
<?php
/* Zend_CodeGenerator_Php_File-DocblockMarker */
Comments
Posted by Raphael de Almeida (jaguarnet7) on 2011-09-07T20:32:00.000+0000
The problem is with Zend_CodeGenerator
I create a UnitTest for this.
Posted by Raphael de Almeida (jaguarnet7) on 2011-09-07T23:20:14.000+0000
The bug occurs in php files with only one docblock. CodeGenerator don't known if one is for file or for class.
When file has docblock and the class too, this bug don't occurs.
Posted by Pádraic Brady (padraic) on 2011-09-11T13:33:09.000+0000
Committed in r24456. Thanks for the patch and tests!!!
Posted by Karol Ciba (keici) on 2011-09-11T14:11:25.000+0000
Thanks for fixing, I can get much better documented code now!