From 3c54e8abd8982ee263597f97e849efe90384fb0d Mon Sep 17 00:00:00 2001 From: Lode Claassen Date: Tue, 9 Aug 2016 16:00:44 +0200 Subject: [PATCH] make sure send_response method has same signature --- src/errors.php | 5 +++-- src/exception.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/errors.php b/src/errors.php index b506154..dd697a6 100644 --- a/src/errors.php +++ b/src/errors.php @@ -108,11 +108,12 @@ public function get_array() { * @param int $encode_options optional, $options for json_encode() * defaults to ::ENCODE_DEFAULT or ::ENCODE_DEBUG, @see ::$debug * @param json $response optional, defaults to ::get_json() + * @param string $jsonp_callback optional, response as jsonp * @return void more so, a string will be echo'd to the browser .. * .. and script execution will terminate */ -public function send_response($content_type=null, $encode_options=null, $response=null) { - parent::send_response($content_type, $encode_options, $response); +public function send_response($content_type=null, $encode_options=null, $response=null, $jsonp_callback=null) { + parent::send_response($content_type, $encode_options, $response, $jsonp_callback); exit; } diff --git a/src/exception.php b/src/exception.php index b60a410..dc19e08 100644 --- a/src/exception.php +++ b/src/exception.php @@ -70,9 +70,9 @@ public function set_about_link($about_link) { * * @see errors->send_response() */ -public function send_response($content_type=null, $encode_options=null, $response=null) { +public function send_response($content_type=null, $encode_options=null, $response=null, $jsonp_callback=null) { $jsonapi = new errors($this, $this->friendly_message, $this->about_link); - $jsonapi->send_response($content_type, $encode_options, $response); + $jsonapi->send_response($content_type, $encode_options, $response, $jsonp_callback); exit; // sanity check }