1
0
mirror of synced 2025-02-07 15:59:27 +03:00

DDC-3493 - fixed EntityGenerator parsing for php 5.5 "::class" syntax

This commit is contained in:
Andrea Sprega 2015-01-15 02:31:18 +00:00 committed by Marco Pivetta
parent 55a75bfb1b
commit 243210e896
2 changed files with 11 additions and 1 deletions

View File

@ -827,7 +827,7 @@ public function __construct(<params>)
if ($token[0] == T_NAMESPACE) { if ($token[0] == T_NAMESPACE) {
$lastSeenNamespace = ""; $lastSeenNamespace = "";
$inNamespace = true; $inNamespace = true;
} elseif ($token[0] == T_CLASS) { } elseif ($token[0] == T_CLASS && $tokens[$i-1][0] != T_DOUBLE_COLON) {
$inClass = true; $inClass = true;
} elseif ($token[0] == T_FUNCTION) { } elseif ($token[0] == T_FUNCTION) {
if ($tokens[$i+2][0] == T_STRING) { if ($tokens[$i+2][0] == T_STRING) {

View File

@ -1035,6 +1035,16 @@ class
', ',
array('Foo\Bar\Baz'), array('Foo\Bar\Baz'),
), ),
array(
'
<?php namespace Foo\Bar; class Baz {
public static function someMethod(){
return self::class;
}
}
',
array('Foo\Bar\Baz'),
),
); );
} }