src/Rbac/DbManager.php
public function getChildRoles($roleName)
    {
        /** @var Role $role */
        $role = null;
        $childrenList = [];
        return $this->getRole($roleName)->then(
            function($roleRow) use (&$role) {
                $role = $roleRow;
                return $this->getChildrenList()
                    ->otherwise(function() { return []; });
            }
        )->then(
            function($childrenRows = []) use (&$childrenList) {
                $childrenList = $childrenRows;
                return $this->getRoles()
                    ->otherwise(function() { return []; });
            }
        )->then(
            function($roles = []) use (&$role, $roleName, &$childrenList) {
                $result = [];
                $this->getChildrenRecursive($roleName, $childrenList, $result);

                $rolesResult = [$roleName => $role];

                $rolesResult += array_filter($roles, function(Role $roleItem) use ($result) {
                    return array_key_exists($roleItem->name, $result);
                });

                return $rolesResult;
            }
        );
    }
public function getChildRoles($roleName)
    {
        /** @var Role $role */
        $role = null;
        $childrenList = [];
        return $this->getRole($roleName)->then(
            function($roleRow) use (&$role) {
                $role = $roleRow;
                return $this->getChildrenList()
                    ->otherwise(function() { return []; });
            }
        )->then(
            function($childrenRows = []) use (&$childrenList) {
                $childrenList = $childrenRows;
                return $this->getRoles()
                    ->otherwise(function() { return []; });
            }
        )->then(
            function($roles = []) use (&$role, $roleName, &$childrenList) {
                $result = [];
                $this->getChildrenRecursive($roleName, $childrenList, $result);

                $rolesResult = [$roleName => $role];

                $rolesResult += array_filter($roles, function(Role $roleItem) use ($result) {
                    return array_key_exists($roleItem->name, $result);
                });

                return $rolesResult;
            }
        );
    }
{@inheritdoc}