Skip to content

Commit 34c0cdd

Browse files
committed
Checking for valid closure now throws an instance of \InvalidArgumentException on failure.
1 parent 9dea002 commit 34c0cdd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Travisjryan/Twilio/Twilio.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public function twiml($callback)
3636

3737
if( $callback instanceof \Closure ) {
3838
call_user_func($callback, $message);
39+
} else {
40+
throw new \InvalidArgumentException("Callback is not valid.");
3941
}
4042

4143
return $message->__toString();
@@ -46,5 +48,5 @@ private function getTwilio()
4648
{
4749
return new \Services_Twilio($this->config['sid'], $this->config['token']);
4850
}
49-
51+
5052
}

0 commit comments

Comments
 (0)