- Fixes PHP static standards error

This commit is contained in:
Vlad
2016-07-22 08:45:46 -04:00
parent d3ebc9706c
commit 5f124659d0

View File

@ -32,7 +32,7 @@ class API {
$endpoint = self::ENDPOINT_NAMESPACE . ucfirst($this->endpoint); $endpoint = self::ENDPOINT_NAMESPACE . ucfirst($this->endpoint);
if(!$this->api_request) return; if(!$this->api_request) return;
if(!$this->endpoint || !class_exists($endpoint)) { if(!$this->endpoint || !class_exists($endpoint)) {
$this->terminateRequest(self::RESPONSE_ERROR, __('Invalid API endpoint.')); self::terminateRequest(self::RESPONSE_ERROR, __('Invalid API endpoint.'));
} }
$this->callEndpoint( $this->callEndpoint(
$endpoint, $endpoint,
@ -43,7 +43,7 @@ class API {
function callEndpoint($endpoint, $action, $data) { function callEndpoint($endpoint, $action, $data) {
if(!method_exists($endpoint, $action)) { if(!method_exists($endpoint, $action)) {
$this->terminateRequest(self::RESPONSE_ERROR, __('Invalid API action.')); self::terminateRequest(self::RESPONSE_ERROR, __('Invalid API action.'));
} }
call_user_func( call_user_func(
array( array(
@ -76,7 +76,7 @@ class API {
return add_query_arg($params, home_url()); return add_query_arg($params, home_url());
} }
function terminateRequest($code, $message) { static function terminateRequest($code, $message) {
status_header($code, $message); status_header($code, $message);
exit; exit;
} }