public function getTraits() : array
    {
        return array_map(
            function (Node\Name $importedTrait) : ReflectionClass {
                return $this->reflectClassForNamedNode($importedTrait);
            },
            array_merge(
                [],
                ...array_map(
                    static function (TraitUse $traitUse) : array {
                        return $traitUse->traits;
                    },
                    array_filter($this->node->stmts, static function (Node $node) : bool {
                        return $node instanceof TraitUse;
                    })
                )
            )
        );
    }
public function getTraits() : array
    {
        return array_map(
            function (Node\Name $importedTrait) : ReflectionClass {
                return $this->reflectClassForNamedNode($importedTrait);
            },
            array_merge(
                [],
                ...array_map(
                    static function (TraitUse $traitUse) : array {
                        return $traitUse->traits;
                    },
                    array_filter($this->node->stmts, static function (Node $node) : bool {
                        return $node instanceof TraitUse;
                    })
                )
            )
        );
    }
public function getTraits ( ) : array { return array_map ( function ( Node \ Name $ importedTrait ) : ReflectionClass { return $ this -> reflectClassForNamedNode ( $ importedTrait ) ; } , array_merge ( [ ] , ... array_map ( static function ( TraitUse $ traitUse ) : array { return $ traitUse -> traits ; } , array_filter ( $ this -> node -> stmts , static function ( Node $ node ) : bool { return $ node instanceof TraitUse ; } ) ) ) ) ; }
Get the traits used, if any are defined. If this class does not have any
defined traits, this will return an empty array.

@return ReflectionClass[]
Get the traits used if any are defined . If this class does not have any defined traits this will return an empty array .