Issues

ZF-7369: Zend_CodeGenerator causes code formatting in an existing file to become mangled.

Issue Type: Bug Created: 2009-07-23T15:15:07.000+0000 Last Updated: 2010-12-19T15:24:46.000+0000 Status: Resolved Fix version(s): - 1.11.2 (30/Dec/10)

Reporter: Khary Sharpe (ksharpe) Assignee: Marc Hodgins (mjh_ca) Tags: - Zend_CodeGenerator

Related issues: - ZF-6982

Attachments: - Method.diff

Description

When reflecting from an existing file using Zend_CodeGenerator_Php_File::fromReflectedFileName(), the code that previously existed gets distorted, in that tab and newline characters are duplicated.

Original:

<pre class="highlight">
if($foo)
{
    bar();
}

Becomes:

<pre class="highlight">
if($foo)

{

        bar();

}

If Repeated becomes

<pre class="highlight">
if($foo)


{

            bar();


}

and so on...

Note however that new code (method) that is added is not affected by this, only the existing code gets mangled.

Comments

Posted by Geneviève Bastien (gbastien) on 2010-01-11T14:06:17.000+0000

This issue was kind of bugging me, so I patched the CodeGenerator/Php/Method.php file with the patch included here

Posted by Marc Hodgins (mjh_ca) on 2010-12-19T15:24:46.000+0000

Resolved in trunk in r23561, merged to 1.11 release branch in r23562.

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