public throwOn ( string $method, object $exception = false, array $args = false ) | ||
$method | string | Method name to throw on. |
$exception | object | Exception object to throw. If not given then a simple Exception object is thrown. |
$args | array | Optional argument list filter. If given then the exception will only be thrown if the method call matches the arguments. |
public function throwOn($method, $exception = false, $args = false)
{
$this->dieOnNoMethod($method, 'throw on');
$this->actions->register($method, $args, new SimpleThrower($exception ? $exception : new Exception()));
}