DDC-3493: New (PHP 5.5) "class" keyword - wrong parsing by EntityGenerator #4304

Closed
opened 2026-01-22 14:39:10 +01:00 by admin · 8 comments
Owner

Originally created by @doctrinebot on GitHub (Jan 14, 2015).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user lukasmaz:

Doctrine command "generate:entitites" is returning Notice Error:
Notice: Uninitialized string offset: 1 in \vendor\doctrine\orm\lib\Doctrine\ORM\Tools\EntityGenerator.php line 674

When trying to use this command on class containing function which is using introduced in 5.5 syntax ClassName::class.

Even simple:
public static function getClass(){
return self::class;
}

is generating a problem.

Originally created by @doctrinebot on GitHub (Jan 14, 2015). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user lukasmaz: Doctrine command "generate:entitites" is returning Notice Error: Notice: Uninitialized string offset: 1 in \vendor\doctrine\orm\lib\Doctrine\ORM\Tools\EntityGenerator.php line 674 When trying to use this command on class containing function which is using introduced in 5.5 syntax ClassName::class. Even simple: public static function getClass(){ return self::class; } is generating a problem.
admin added the Bug label 2026-01-22 14:39:10 +01:00
admin closed this issue 2026-01-22 14:39:10 +01:00
Author
Owner
@doctrinebot commented on GitHub (Jan 14, 2015): - depends on [DDC-3494: [GH-1250] Test case for "class" keyword](http://www.doctrine-project.org/jira/browse/DDC-3494) - depends on [DDC-3502: [GH-1256] DDC-3493 - fixed EntityGenerator parsing for php 5.5 "::class" syntax](http://www.doctrine-project.org/jira/browse/DDC-3502)
Author
Owner

@doctrinebot commented on GitHub (Jan 14, 2015):

Comment created by @ocramius:

[~lukasmaz] can you come up with a test case to be added to doctrine/common?

See b44549dcc9/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php as a reference for that.

@doctrinebot commented on GitHub (Jan 14, 2015): Comment created by @ocramius: [~lukasmaz] can you come up with a test case to be added to doctrine/common? See https://github.com/doctrine/common/blob/b44549dcc98a18f0728df05df523bdf179edb90b/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php as a reference for that.
Author
Owner

@doctrinebot commented on GitHub (Jan 14, 2015):

Comment created by @ocramius:

Ah, my mistake: this is about the entity generator. See 9c3cb57931/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php instead.

@doctrinebot commented on GitHub (Jan 14, 2015): Comment created by @ocramius: Ah, my mistake: this is about the entity generator. See https://github.com/doctrine/doctrine2/blob/9c3cb579313ae01cdd3467b9f89fc15e9677b46c/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php instead.
Author
Owner

@doctrinebot commented on GitHub (Jan 14, 2015):

Comment created by lukasmaz:

[~ocramius] to be honest this stuff is still new for me - I am learning Symfony2&Doctrine and wanted to report this issue - to help somehow :) I do not fully understand whats going on in those test cases :/

@doctrinebot commented on GitHub (Jan 14, 2015): Comment created by lukasmaz: [~ocramius] to be honest this stuff is still new for me - I am learning Symfony2&Doctrine and wanted to report this issue - to help somehow :) I do not fully understand whats going on in those test cases :/
Author
Owner

@doctrinebot commented on GitHub (Jan 14, 2015):

Comment created by @ocramius:

[~lukasmaz] we're all pretty much in a rush to get 2.5 out, so please consider hopping in IRC and I should help you setting up the test suite.

irc.freenode.net, channel #doctrine-dev, poke "Ocramius" there

@doctrinebot commented on GitHub (Jan 14, 2015): Comment created by @ocramius: [~lukasmaz] we're all pretty much in a rush to get 2.5 out, so please consider hopping in IRC and I should help you setting up the test suite. irc.freenode.net, channel #doctrine-dev, poke "Ocramius" there
Author
Owner

@doctrinebot commented on GitHub (Jan 14, 2015):

Comment created by asprega:

I'd like to take care of the issue if not yet assigned.

@doctrinebot commented on GitHub (Jan 14, 2015): Comment created by asprega: I'd like to take care of the issue if not yet assigned.
Author
Owner

@doctrinebot commented on GitHub (Jan 15, 2015):

Comment created by @ocramius:

Handled in DDC-3502

@doctrinebot commented on GitHub (Jan 15, 2015): Comment created by @ocramius: Handled in [DDC-3502](http://www.doctrine-project.org/jira/browse/DDC-3502)
Author
Owner

@doctrinebot commented on GitHub (Jan 15, 2015):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jan 15, 2015): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4304