/** * @param callable $getter * @return Cli */ public function setWindowWidthGetter($getter) { $exceptions = new Exceptions(); $exceptions->throwIfIsNotCallable($getter); $this->windowWidthGetter = $getter; return $this; }
/** * Method only for catching errors, without friendly output. * * @param $callable * @param int|null $mode * @param int $errorTypes * @throws Helpers\NotCallableException */ public static function registerErrorCallback($callable, $mode = null, $errorTypes = RegisterErrorHandler::TYPE_ALL) { $exceptions = new Exceptions(); $exceptions->throwIfIsNotCallable($callable); $registerErrorHandler = new RegisterErrorHandler($callable, $mode); $registerErrorHandler->register($errorTypes); }
/** * @param DumpFunctionInterface $function * @return Html * @throws \ErrorDumper\Helpers\NotCallableException */ public function setVarDumpFn(DumpFunctionInterface $function) { $exceptions = new Exceptions(); $exceptions->throwIfIsNotCallable($function); $this->varDumpFn = $function; return $this; }
public function setPreCallback($callback) { $exceptions = new Exceptions(); $exceptions->throwIfIsNotCallable($callback); $this->preCallback = $callback; return $this; }
public function setCallable($callable) { $exceptions = new Exceptions(); $exceptions->throwIfIsNotCallable($callable); $this->callable = $callable; return $this; }
/** * @dataProvider providerTestThrowIfIsNotCallable * @param $value * @param bool $callable */ public function testThrowIfIsNotCallable($value, $callable) { if (!$callable) { $this->setExpectedException('ErrorDumper\\Helpers\\NotCallableException'); } $exceptions = new Exceptions(); $exceptions->throwIfIsNotCallable($value); }