public function getInheritanceList(): array
    {
        $roleList = [$this];
        $role = $this;
        while ($parentRole = $role->getParent()) {
            $roleList[] = $parentRole;
            $role = $parentRole;
        }

        return $roleList;
    }
public function getInheritanceList(): array
    {
        $roleList = [$this];
        $role = $this;
        while ($parentRole = $role->getParent()) {
            $roleList[] = $parentRole;
            $role = $parentRole;
        }

        return $roleList;
    }
public function getInheritanceList ( ) : array { $ roleList = [ $ this ] ; $ role = $ this ; while ( $ parentRole = $ role -> getParent ( ) ) { $ roleList [ ] = $ parentRole ; $ role = $ parentRole ; } return $ roleList ; }
Return all inherited roles, including the start role, in this to-root traversal.
@return array
Return all inherited roles including the start role in this to - root traversal .