BetterReflection\Reflection\ReflectionClass::getName PHP Method

getName() public method

Get the "full" name of the class (e.g. for A\B\Foo, this will return "A\B\Foo").
public getName ( ) : string
return string
    public function getName()
    {
        if (!$this->inNamespace()) {
            return $this->getShortName();
        }
        return $this->getNamespaceName() . '\\' . $this->getShortName();
    }

Usage Example

 /**
  * @param ReflectionClass $class
  *
  * @return self
  */
 public static function fromReflectionClass(ReflectionClass $class)
 {
     $type = 'class';
     if ($class->isTrait()) {
         $type = 'trait';
     }
     return new self(sprintf('Provided node "%s" is not interface, but "%s"', $class->getName(), $type));
 }
All Usage Examples Of BetterReflection\Reflection\ReflectionClass::getName