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
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.