public function useConfigurationCallable(\closure $callback)
{
$script = call_user_func($this->configuratorFactory, $this);
$runner = $this->runner;
$errors = array();
$this->adapter->set_error_handler(function ($error, $message, $file, $line, $context) use(&$errors) {
foreach (array_reverse(debug_backtrace()) as $trace) {
if (isset($trace['file']) === true && $trace['file'] === __DIR__) {
$file = __DIR__;
$line = $trace['line'];
break;
}
}
$errors[] = array($error, $message, $file, $line, $context);
});
$callback($script, $runner);
$this->adapter->restore_error_handler();
if (sizeof($errors) > 0) {
list($error, $message, $file, $line, $context) = $errors[0];
throw new exceptions\runtime('Unable to configure runner. ' . atoum\asserters\error::getAsString($error) . ': ' . $message . ' in ' . $file . ' on line ' . $line);
}
return $this;
}