PhpParser\Node\Name::isRelative PHP Метод

isRelative() публичный Метод

Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name)
public isRelative ( ) : boolean
Результат boolean Whether the name is relative
    public function isRelative()
    {
        return false;
    }

Usage Example

Пример #1
0
 protected function resolveClassName(Name $name)
 {
     // don't resolve special class names
     if (in_array(strtolower($name->toString()), array('self', 'parent', 'static'))) {
         if (!$name->isUnqualified()) {
             throw new Error(sprintf("'\\%s' is an invalid class name", $name->toString()), $name->getLine());
         }
         return $name;
     }
     // fully qualified names are already resolved
     if ($name->isFullyQualified()) {
         return $name;
     }
     $aliasName = strtolower($name->getFirst());
     if (!$name->isRelative() && isset($this->aliases[Stmt\Use_::TYPE_NORMAL][$aliasName])) {
         // resolve aliases (for non-relative names)
         $name->setFirst($this->aliases[Stmt\Use_::TYPE_NORMAL][$aliasName]);
     } elseif (null !== $this->namespace) {
         // if no alias exists prepend current namespace
         $name->prepend($this->namespace);
     }
     return new Name\FullyQualified($name->parts, $name->getAttributes());
 }
All Usage Examples Of PhpParser\Node\Name::isRelative