diff --git a/application/controllers/ImportsourcesController.php b/application/controllers/ImportsourcesController.php index 5d473778..42872927 100644 --- a/application/controllers/ImportsourcesController.php +++ b/application/controllers/ImportsourcesController.php @@ -11,20 +11,6 @@ class ImportsourcesController extends ActionController { protected $isApified = true; - protected function sendUnsupportedMethod() - { - $method = strtoupper($this->getRequest()->getMethod()) ; - $response = $this->getResponse(); - $this->sendJsonError($response, sprintf( - 'Method %s is not supported', - $method - ), 422); // TODO: check response code - } - - /** - * @throws \Icinga\Exception\ConfigurationError - * @throws \Icinga\Exception\Http\HttpNotFoundException - */ public function indexAction() { if ($this->getRequest()->isApiRequest()) { @@ -55,16 +41,12 @@ class ImportsourcesController extends ActionController /** * @param $raw - * @throws \Icinga\Exception\ConfigurationError */ - protected function acceptImport(&$raw) + protected function acceptImport($raw) { (new ImportExport($this->db()))->unserializeImportSources(json_decode($raw)); } - /** - * @throws \Icinga\Exception\ConfigurationError - */ protected function sendExport() { $this->sendJson( diff --git a/library/Director/Web/Controller/ActionController.php b/library/Director/Web/Controller/ActionController.php index dccc6dc8..c80a98bf 100644 --- a/library/Director/Web/Controller/ActionController.php +++ b/library/Director/Web/Controller/ActionController.php @@ -188,6 +188,16 @@ abstract class ActionController extends Controller implements ControlsAndContent return $this; } + protected function sendUnsupportedMethod() + { + $method = strtoupper($this->getRequest()->getMethod()) ; + $response = $this->getResponse(); + $this->sendJsonError($response, sprintf( + 'Method %s is not supported', + $method + ), 422); // TODO: check response code + } + /** * @param string $permission * @return $this