Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1660

Annotation @version is not allowed to be declared on class

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.2.1
    • Component/s: Mapping Drivers, ORM
    • Security Level: All
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Merged PR into master and 2.2

        Show
        Benjamin Eberlei added a comment - Merged PR into master and 2.2
        Hide
        Benjamin Eberlei added a comment -

        This breaks BC, so we cant do this.

        Show
        Benjamin Eberlei added a comment - This breaks BC, so we cant do this.
        Hide
        Fabio B. Silva added a comment -

        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 :
        https://github.com/FabioBatSilva/common/commit/842bf5883c405e89d211e5ccfff1d8d64e05a486

        Show
        Fabio B. Silva added a comment - 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 : https://github.com/FabioBatSilva/common/commit/842bf5883c405e89d211e5ccfff1d8d64e05a486
        Hide
        Benjamin Eberlei added a comment -

        Its definately a BC break.

        Show
        Benjamin Eberlei added a comment - Its definately a BC break.
        Hide
        Benjamin Eberlei added a comment -

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

        Show
        Benjamin Eberlei added a comment - Hm maybe the SimpleAnnotationReader should not validate targets? What do you say Fabio/Johannes?

          People

          • Assignee:
            Fabio B. Silva
            Reporter:
            Miroslav Fedeles
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: