DDC-1660: Annotation @version is not allowed to be declared on class #2304

Closed
doctrinebot opened this Issue Feb 20, 2012 · 6 comments

1 participant

@doctrinebot

Jira issue originally created by user fedys:

I upgraded to Doctrine 2.2 and got following exception:

"Doctrine\Common\Annotations\AnnotationException [Semantical Error] Annotation @version is not allowed to be declared on class SomeEntityClass. You may only use this annotation on these code elements: PROPERTY."

In Doctrine 2.1 no such exception has been thrown. I use following annotation for all my classes in my projects:

@version $Id: SomeEntityClass.php 509 2012-02-03 09:38:48Z mf $

Thus I cannot upgrade to Doctrine 2.2 for now.

@doctrinebot

Comment created by @beberlei:

Hm maybe the SimpleAnnotationReader should not validate targets? What do you say Fabio/Johannes?

@doctrinebot

Comment created by @beberlei:

Its definately a BC break.

@doctrinebot

Comment created by @FabioBatSilva:

Hi Benjamin

This parser identifies the phpdoc annotation @version as the doctrine annotation @Doctrine\ORM\Mapping\Version

SimpleReader does not recognize entity imports. If consider the namespaces (SimpleAnnotationReader#addNamespace), this annotation exists within the namespace "Doctrine\ORM\Mapping\"

This could be fixed considering just CamelCaseClasses, so @version is not equal @Version

Benjamin and Johannes, please take a look at this commit :
FabioBatSilva/common@842bf58

@doctrinebot

Comment created by @beberlei:

This breaks BC, so we cant do this.

@doctrinebot

Comment created by @beberlei:

Merged PR into master and 2.2

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.2.1 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment