PhpParser\Node\Name::getFirst PHP Method

getFirst() public method

Gets the first part of the name, i.e. everything before the first namespace separator.
public getFirst ( ) : string
return string First part of the name
    public function getFirst()
    {
        return $this->parts[0];
    }

Usage Example

Ejemplo n.º 1
0
 public function getFQCN(Name $node = null)
 {
     if ($node === null) {
         return $node;
     }
     if ($node->isFullyQualified()) {
         return $this->parseFQCN($node->toString());
     }
     $fqcn = $this->uses->find($node->getFirst());
     if ($fqcn) {
         return $fqcn;
     }
     return $this->createFQCN($node->toString());
 }
All Usage Examples Of PhpParser\Node\Name::getFirst