mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1660: Annotation @version is not allowed to be declared on class #2085
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Feb 20, 2012).
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 mfThus I cannot upgrade to Doctrine 2.2 for now.
@doctrinebot commented on GitHub (Feb 20, 2012):
Comment created by @beberlei:
Hm maybe the SimpleAnnotationReader should not validate targets? What do you say Fabio/Johannes?
@doctrinebot commented on GitHub (Feb 20, 2012):
Comment created by @beberlei:
Its definately a BC break.
@doctrinebot commented on GitHub (Feb 20, 2012):
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 :
842bf5883c@doctrinebot commented on GitHub (Feb 20, 2012):
Comment created by @beberlei:
This breaks BC, so we cant do this.
@doctrinebot commented on GitHub (Mar 3, 2012):
Comment created by @beberlei:
Merged PR into master and 2.2
@doctrinebot commented on GitHub (Mar 3, 2012):
Issue was closed with resolution "Fixed"