Doctrine Common
  1. Doctrine Common
  2. DCOM-4

Cannot use namespace separator and namespace alias at the same time for annotations

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-BETA2
    • Component/s: None
    • Labels:
      None

      Description

      In the function Annotation() in \Doctrine\Common\Annotations\Parser.php (~line 225)

      There is a check for how many $nameParts there are, and the doctrine code will only append the namespace aliases if there are no namespace separators.

      There is also an argument against modification since the user of the code could just define more namespace aliases, but I feel that it should be able to cope with a namespace alias and a namespace separator at the same time.

        Activity

        Hide
        Benjamin Eberlei added a comment -

        From our discussion on IRC, the problems here are:

        • Annotations that don't have classes don't really throw an appropriate exception (error message)
        • The \ separator inside an annotation does not throw an appropriate exception.
        Show
        Benjamin Eberlei added a comment - From our discussion on IRC, the problems here are: Annotations that don't have classes don't really throw an appropriate exception (error message) The \ separator inside an annotation does not throw an appropriate exception.
        Hide
        Tim Nagel added a comment -

        Proposed solution to the namespace separators: http://github.com/merk/common/commit/b31166c6a85235e03935a4b41f5a54aa478f6c6b

        I am unsure about throwing exception messages or doing anything too fancy in this area since there will be instances where other annotations are used for other purposes (phpdoc, etc) where you only want to ignore them.

        Show
        Tim Nagel added a comment - Proposed solution to the namespace separators: http://github.com/merk/common/commit/b31166c6a85235e03935a4b41f5a54aa478f6c6b I am unsure about throwing exception messages or doing anything too fancy in this area since there will be instances where other annotations are used for other purposes (phpdoc, etc) where you only want to ignore them.

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Tim Nagel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: