/** * Run MOD PreValidator. * * @return \Symfony\Component\HttpFoundation\Response */ protected function mpv() { if (!$this->contrib->type->mpv_test) { return $this->helper->error('INVALID_TOOl'); } // Run MPV $prevalidator = $this->contrib->type->get_prevalidator(); $results = $prevalidator->run_mpv($this->attachment->get_url()); $errors = $prevalidator->get_errors(); if ($results === false) { return $this->helper->error('MPV_TEST_FAILED'); } else { $results = $this->get_result_post('VALIDATION_PV', $results); $post = $this->queue->topic_reply($results); } if (!empty($errors)) { return $this->helper->error(implode('<br />', $errors)); } redirect($post->get_url()); }
/** * Run step function. * * @param string|array $function Callable function. * @return array */ protected function run_step($function) { $download_url = $this->attachment ? $this->attachment->get_url() : ''; return call_user_func_array($function, array($this->contrib, $this->revision, $this->attachment, $download_url, $this->package, $this->template)); }