src/Whoops/Run.php
public function pushHandler($handler)
    {
        if (is_callable($handler)) {
            $handler = new CallbackHandler($handler);
        }

        if (!$handler instanceof HandlerInterface) {
            throw new InvalidArgumentException(
                  "Argument to " . __METHOD__ . " must be a callable, or instance of "
                . "Whoops\\Handler\\HandlerInterface"
            );
        }

        $this->handlerStack[] = $handler;
        return $this;
    }
public function pushHandler($handler)
    {
        if (is_callable($handler)) {
            $handler = new CallbackHandler($handler);
        }

        if (!$handler instanceof HandlerInterface) {
            throw new InvalidArgumentException(
                  "Argument to " . __METHOD__ . " must be a callable, or instance of "
                . "Whoops\\Handler\\HandlerInterface"
            );
        }

        $this->handlerStack[] = $handler;
        return $this;
    }
public function pushHandler ( $ handler ) { if ( is_callable ( $ handler ) ) { $ handler = new CallbackHandler ( $ handler ) ; } if ( ! $ handler instanceof HandlerInterface ) { throw new InvalidArgumentException ( "Argument to " . __METHOD__ . " must be a callable, or instance of " . "Whoops\\Handler\\HandlerInterface" ) ; } $ this -> handlerStack [ ] = $ handler ; return $ this ; }
Pushes a handler to the end of the stack

@throws InvalidArgumentException  If argument is not callable or instance of HandlerInterface
@param  Callable|HandlerInterface $handler
@return Run
Pushes a handler to the end of the stack