public static function factory(Request $request)
    {
        /** @var Action[] $actions */
        $actions = self::getAllActions($request);

        foreach ($actions as $actionType) {
            if (empty($action)) {
                $action = $actionType;
                continue;
            }

            $posPrevious = self::getPriority($action);
            $posCurrent  = self::getPriority($actionType);

            if ($posCurrent > $posPrevious) {
                $action = $actionType;
            }
        }

        if (!empty($action)) {
            return $action;
        }

        return new ActionPageview($request);
    }
public static function factory(Request $request)
    {
        /** @var Action[] $actions */
        $actions = self::getAllActions($request);

        foreach ($actions as $actionType) {
            if (empty($action)) {
                $action = $actionType;
                continue;
            }

            $posPrevious = self::getPriority($action);
            $posCurrent  = self::getPriority($actionType);

            if ($posCurrent > $posPrevious) {
                $action = $actionType;
            }
        }

        if (!empty($action)) {
            return $action;
        }

        return new ActionPageview($request);
    }
public static function factory ( Request $ request ) { /** @var Action[] $actions */ $ actions = self :: getAllActions ( $ request ) ; foreach ( $ actions as $ actionType ) { if ( empty ( $ action ) ) { $ action = $ actionType ; continue ; } $ posPrevious = self :: getPriority ( $ action ) ; $ posCurrent = self :: getPriority ( $ actionType ) ; if ( $ posCurrent > $ posPrevious ) { $ action = $ actionType ; } } if ( ! empty ( $ action ) ) { return $ action ; } return new ActionPageview ( $ request ) ; }
Makes the correct Action object based on the request.

@param Request $request
@return Action
Makes the correct Action object based on the request .