ZF-10870: Zend_Reflection_Method::getBody fails with multi-line method signature
Description
When you declare a function in multiple lines (because of the golden "80-characters-a-line"-rule for example):
function myFunction($arga, $argb, $argc,
$argd, $arge
) {
...
}
"getBody" returns everything from line 2:
$argd, $arge
) {
....
which is extremely poor when using Zend_CodeGenerator, which relies on this function. The attached patch resolves the issue with current 1.11.
Comments
Posted by Dennis Ploeger (ploeger) on 2010-12-27T07:11:49.000+0000
Hmmm... don't know, how to attach something here, so here's the patch:
Posted by Dennis Ploeger (ploeger) on 2010-12-28T02:28:11.000+0000
The patch above is wrong (there's a special character outputted as well) This one corrects it and should also work on Windows systems:
Posted by Dennis Ploeger (ploeger) on 2010-12-28T05:07:15.000+0000
Argh! Still wrong. This should do it:
Posted by Marc Hodgins (mjh_ca) on 2010-12-29T01:44:14.000+0000
Dennis, have you signed a CLA? Patches can't be accepted without a signed CLA. Your JIRA profile doesn't have you tagged to the dev group.
Posted by Adam Lundrigan (adamlundrigan) on 2012-06-01T18:30:47.000+0000
[Edit: Code removed]
Complete patch is attached.
Posted by Adam Lundrigan (adamlundrigan) on 2012-06-01T18:50:41.000+0000
Added updated patch (v2) to also work with inline methods (ie: signature and body on same line)
Posted by Adam Lundrigan (adamlundrigan) on 2012-06-02T02:16:54.000+0000
Fixed in trunk (1.12.0): r24870