ZF-12155: Zend_Reflection_File doesn't handle complex parsed variable syntax properly
Description
Zend_Reflection_File::_reflect() doesn't handle T_CURLY_OPEN | T_DOLLAR_OPEN_CURLY_BRACES as $openBraces given a parsing error.
I fixed the problem adding:
class: Zend_Reflection_File 339: switch ($type) { 340: // Special curly open situations 341: case T_CURLY_OPEN | T_DOLLAR_OPEN_CURLY_BRACES : 342: $openBraces++; 343: continue;
Comments
Posted by Adam Lundrigan (adamlundrigan) on 2012-05-08T19:29:50.000+0000
Can you provide a sample of code which causes Zend_Reflection_File to misbehave?
Posted by Facundo Cabrera (facundo) on 2012-05-09T11:17:39.000+0000
function test ( ) { $hello = 'hello'; $world = 'world';
$phrase = "{$hello} {$world}"; }
function test2 () { // you wont see this function after parsing because {$ doesn't match a common { but } does. }
Posted by Adam Lundrigan (adamlundrigan) on 2012-05-14T11:28:16.000+0000
Attached reproducing unit test
Posted by Adam Lundrigan (adamlundrigan) on 2012-05-14T12:19:52.000+0000
Attached fix and updated test
Posted by Adam Lundrigan (adamlundrigan) on 2012-05-14T12:24:05.000+0000
Fixed in trunk (1.12.0): r24803
Posted by Adam Lundrigan (adamlundrigan) on 2012-05-14T12:41:58.000+0000
No ZF2 PR issued, as this feature is incomplete in ZF2. See: https://github.com/zendframework/zf2/…