Example #1
0
 /**
  * @param $bool
  * @throws \Savage\BooBoo\Exception\NoFormattersRegisteredException
  */
 public function registerErrorHandler($bool)
 {
     if ($bool) {
         $this->errorHandler->register();
     } else {
         $this->errorHandler->deregister();
     }
 }
 /**
  * Register BooBoo error handler.
  */
 public function register()
 {
     $runner = new Runner();
     foreach ($this->formatters as $formatter) {
         $runner->pushFormatter($formatter);
     }
     if (count($this->formatters) === 0) {
         $runner->pushFormatter(new NullFormatter());
     }
     foreach ($this->handlers as $handler) {
         $runner->pushHandler($handler);
     }
     $runner->register();
 }