From ddf3125afefd62b00d4226c114cb9d643c8a50cd Mon Sep 17 00:00:00 2001 From: lukasmaz Date: Wed, 14 Jan 2015 11:56:54 +0100 Subject: [PATCH 1/2] Test case for "class" keyword Test case for http://www.doctrine-project.org/jira/browse/DDC-3493 --- tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php index 651424c22..89eea1baf 100644 --- a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php @@ -552,6 +552,16 @@ class ', array('Foo\Bar\Baz'), ), + array( + ' + Date: Thu, 15 Jan 2015 02:31:18 +0000 Subject: [PATCH 2/2] DDC-3493 - fixed EntityGenerator parsing for php 5.5 "::class" syntax --- lib/Doctrine/ORM/Tools/EntityGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index ec3a6e143..29caf1b11 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -679,7 +679,7 @@ public function __construct() 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) {