original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: Makes the correct Action object based on the request.
  
  @param Request $request
  @return Action
docstring_tokens: Makes the correct Action object based on the request .