Skip to content

Commit

Permalink
Merge branch 'hotfix/#1250-DDC-3493-fix-class-pseudo-constant-parsing…
Browse files Browse the repository at this point in the history
…-in-entitygenerator'
  • Loading branch information
Ocramius committed Jan 15, 2015
2 parents a1d77bd + 5be57d0 commit 5bd9211
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Tools/EntityGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ protected function parseTokensInEntityFile($src)
if ($token[0] == T_NAMESPACE) {
$lastSeenNamespace = "";
$inNamespace = true;
} elseif ($token[0] == T_CLASS) {
} elseif ($token[0] == T_CLASS && $tokens[$i-1][0] != T_DOUBLE_COLON) {
$inClass = true;
} elseif ($token[0] == T_FUNCTION) {
if ($tokens[$i+2][0] == T_STRING) {
Expand Down
10 changes: 10 additions & 0 deletions tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,16 @@ class
',
array('Foo\Bar\Baz'),
),
array(
'
<?php namespace Foo\Bar; class Baz {
public static function someMethod(){
return self::class;
}
}
',
array('Foo\Bar\Baz'),
),
);
}

Expand Down

0 comments on commit 5bd9211

Please sign in to comment.