BetterReflection\Reflection\ReflectionClass::getNamespaceName PHP Method

getNamespaceName() public method

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

Usage Example

 /**
  * {@inheritDoc}
  */
 public function getNamespaceName()
 {
     return $this->betterReflectionClass->getNamespaceName();
 }