BetterReflection\Reflection\ReflectionClass::getTraitNames PHP Method

getTraitNames() public method

You may optionally specify a source locator that will be used to locate the traits. If no source locator is given, a default will be used.
public getTraitNames ( ) : string[]
return string[]
    public function getTraitNames()
    {
        return array_map(function (ReflectionClass $trait) {
            return $trait->getName();
        }, $this->getTraits());
    }

Usage Example

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