protected function setExceptionHandler($class, string $methodName = 'handleException'): Environment
    {
        if (!is_string($class) && !is_object($class)) {
            throw new \InvalidArgumentException(
                    'Given class must be a class name or a class instance.'
            );
        }

        $this->exceptionHandler = ['class' => $class, 'method' => $methodName];
        return $this;
    }
protected function setExceptionHandler($class, string $methodName = 'handleException'): Environment
    {
        if (!is_string($class) && !is_object($class)) {
            throw new \InvalidArgumentException(
                    'Given class must be a class name or a class instance.'
            );
        }

        $this->exceptionHandler = ['class' => $class, 'method' => $methodName];
        return $this;
    }
protected function setExceptionHandler ( $ class , string $ methodName = 'handleException' ) : Environment { if ( ! is_string ( $ class ) && ! is_object ( $ class ) ) { throw new \ InvalidArgumentException ( 'Given class must be a class name or a class instance.' ) ; } $ this -> exceptionHandler = [ 'class' => $ class , 'method' => $ methodName ] ; return $ this ; }
sets the exception handler to given class and method name

To register the new exception handler call registerExceptionHandler().

@param   string|object  $class        name or instance of exception handler class
@param   string         $methodName   name of exception handler method
@return  \stubbles\Environment
sets the exception handler to given class and method name