Issues

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

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:


if($foo)
{
    bar();
}

Becomes:


if($foo)

{

        bar();

}

If Repeated becomes


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

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

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