Skip to content

Commit

Permalink
make sure send_response method has same signature
Browse files Browse the repository at this point in the history
  • Loading branch information
lode committed Aug 9, 2016
1 parent c1f15d5 commit 3c54e8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/errors.php
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions src/exception.php
Expand Up @@ -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
}

Expand Down

0 comments on commit 3c54e8a

Please sign in to comment.