Skip to content

Commit

Permalink
Checking for valid closure now throws an instance of \InvalidArgument…
Browse files Browse the repository at this point in the history
…Exception on failure.
  • Loading branch information
anasterism committed May 10, 2014
1 parent 9dea002 commit 34c0cdd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Travisjryan/Twilio/Twilio.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public function twiml($callback)

if( $callback instanceof \Closure ) {
call_user_func($callback, $message);
} else {
throw new \InvalidArgumentException("Callback is not valid.");
}

return $message->__toString();
Expand All @@ -46,5 +48,5 @@ private function getTwilio()
{
return new \Services_Twilio($this->config['sid'], $this->config['token']);
}

}

0 comments on commit 34c0cdd

Please sign in to comment.