Commit 6c9de9e0 authored by Thierry Bugier's avatar Thierry Bugier Committed by Johan Cwiklinski
Browse files

fix inconsistency in method signature

argument names and default values not matching signatures in inherited classes
parent 1cb79faa
......@@ -68,13 +68,15 @@ abstract class API extends CommonGLPI {
/**
* Generic messages
*
* @since 9.1
*
* @param mixed $response string message or array of data to send
* @param integer $code http code
* @param integer $httpcode http code (see : https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
* @param array $additionalheaders headers to send with http response (must be an array(key => value))
*
* @return void
*/
abstract protected function returnResponse($response, $code, $additionalheaders);
abstract protected function returnResponse($response, $httpcode = 200, $additionalheaders = []);
/**
* Upload and validate files from request and append to $this->parameters['input']
......
......@@ -521,16 +521,6 @@ class APIRest extends API {
}
/**
* Generic function to send a message and an http code to client
*
* @param string $response message or array of data to send
* @param integer $httpcode http code (default 200)
* (see: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
* @param array $additionalheaders headers to send with http response (must be an array(key => value))
*
* @return void
*/
public function returnResponse($response, $httpcode = 200, $additionalheaders = []) {
if (empty($httpcode)) {
......
......@@ -285,17 +285,7 @@ class APIXmlrpc extends API {
return $resource;
}
/**
* Generic function to send a message and an http code to client
*
* @since 9.1
*
* @param mixed $response string message or array of data to send
* @param integer $httpcode http code (see : https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
* @param array $additionalheaders headers to send with http response (must be an array(key => value))
*
* @return void
*/
protected function returnResponse($response, $httpcode = 200, $additionalheaders = []) {
if (empty($httpcode)) {
$httpcode = 200;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment