Doctrine Common
  1. Doctrine Common
  2. DCOM-229

DocParser - add support for php5 MyClass::class call to get path of the class

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Trivial Trivial
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Annotations
    • Labels:
      None

      Description

      When I try to use in my annotations

       
      Career::class
      

      I get Semantical Error. Career is imported, so I dont want to use full class path name again. How about to add this feature to support by annotations?
      We need to add some code like this (DocParser#Constant):

       
                  if ($found) {
                       if ($const === 'class') {
                          return $className;
                       }
      
                       $identifier = $className . '::' . $const;
                  }
              }
      
              if (!defined($identifier)) {
                  throw AnnotationException::semanticalErrorConstants($identifier, $this->context);
              }
      
              return constant($identifier);
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Umed
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: