Layton/App.php
private function getMiddleWareFromGroup(RouteGroup $group, array $middleWareList = [])
    {
        if ($group->middleWare) {
            $middleWareList = \array_merge($group->middleWare, $middleWareList);
        }
        if (\is_null($group->parentGroup)) {
            return $middleWareList;
        }
        return $this->getMiddleWareFromGroup($group->parentGroup, $middleWareList);
    }
private function getMiddleWareFromGroup(RouteGroup $group, array $middleWareList = [])
    {
        if ($group->middleWare) {
            $middleWareList = \array_merge($group->middleWare, $middleWareList);
        }
        if (\is_null($group->parentGroup)) {
            return $middleWareList;
        }
        return $this->getMiddleWareFromGroup($group->parentGroup, $middleWareList);
    }
private function getMiddleWareFromGroup ( RouteGroup $ group , array $ middleWareList = [ ] ) { if ( $ group -> middleWare ) { $ middleWareList = \ array_merge ( $ group -> middleWare , $ middleWareList ) ; } if ( \ is_null ( $ group -> parentGroup ) ) { return $ middleWareList ; } return $ this -> getMiddleWareFromGroup ( $ group -> parentGroup , $ middleWareList ) ; }
Merge all middlewares from group and parent-group.

@param RouteGroup $group The first route group.
@param array $middleWareList Swap of middlewares.

@return array All middlewares.
Merge all middlewares from group and parent - group .