Issues

ZF-10244: adding action to controller messes up existing functions

Issue Type: Bug Created: 2010-07-29T01:01:32.000+0000 Last Updated: 2010-11-23T21:55:47.000+0000 Status: Resolved Fix version(s): Reporter: Simon (_sims_) Assignee: Ramon Henrique Ornelas (ramon) Tags: - Zend_Tool

Related issues: - ZF-9501

Attachments:

Description

When you add an action to a controller that already has data in it, the closing curly brace before the function's closing on each function gets removed and the functions get some strange new indentation on everything but the first line.

I've been bitten by this a few times and thought it was fixed by now. I also thought I reported this before, but I can't see a bug report for it.

Comments

Posted by Martin Hujer (mhujer) on 2010-08-02T08:30:06.000+0000

Steps to reproduce the issue:

zf create project test

Changed IndexController - indexAction to:

<pre class="highlight"><?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        if ($this->getRequest()->isPost()) {
            //something
            if ($form->isValid($_POST)) {
                //something
            }
        }
    }

}

cd test zf create action foo

And the IndexController looks this way:

<pre class="highlight"><?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        if ($this->getRequest()->isPost()) {
                    //something
                    if ($form->isValid($_POST)) {
                        //something
                    }
    }

    public function fooAction()
    {
        // action body
    }


}

Posted by Martin Hujer (mhujer) on 2010-08-02T08:31:07.000+0000

still broken in 1.10.7

Posted by Ramon Henrique Ornelas (ramon) on 2010-11-20T11:37:09.000+0000

This problem is related to Zend_Reflection_Method::getBody(). See issue ZF-9018.

Greetings Ramon

Posted by Ramon Henrique Ornelas (ramon) on 2010-11-20T11:39:11.000+0000

Issue duplicated of ZF-9501

Posted by Marc Hodgins (mjh_ca) on 2010-11-23T21:55:47.000+0000

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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts