Exemplo n.º 1
0
 /**
  * Parses a php class/method name chain.
  *
  * <code>
  * PHP\Depend\Parser::parse();
  * </code>
  *
  * @return string
  * @link http://php.net/manual/en/language.namespaces.importing.php
  */
 protected function parseQualifiedName()
 {
     $fragments = $this->_parseQualifiedNameRaw();
     // Check for fully qualified name
     if ($fragments[0] === '\\') {
         return join('', $fragments);
     }
     // Search for an use alias
     $mapsTo = $this->_useSymbolTable->lookup($fragments[0]);
     if ($mapsTo !== null) {
         // Remove alias and add real namespace
         array_shift($fragments);
         array_unshift($fragments, $mapsTo);
     } else {
         if ($this->_namespaceName !== null && $this->_namespacePrefixReplaced === false) {
             // Prepend current namespace
             array_unshift($fragments, $this->_namespaceName, '\\');
         }
     }
     return join('', $fragments);
 }