public function halt(HaltPropagationException $exception = null)
    {
        if ($this->haltEvent !== "") {
            $pointer = $this->middleware instanceof MiddlewareCollection ? $this->middleware->current() : $this->middleware;
            $event = $this->haltEvent;

            if (is_callable(static::$eventCallable)) {
                static::$eventCallable(new $event($pointer, $exception));
            }
        }

        if ($exception !== null && ! $this->catchHalt) {
            throw $exception;
        }

        return $this;
    }
public function halt(HaltPropagationException $exception = null)
    {
        if ($this->haltEvent !== "") {
            $pointer = $this->middleware instanceof MiddlewareCollection ? $this->middleware->current() : $this->middleware;
            $event = $this->haltEvent;

            if (is_callable(static::$eventCallable)) {
                static::$eventCallable(new $event($pointer, $exception));
            }
        }

        if ($exception !== null && ! $this->catchHalt) {
            throw $exception;
        }

        return $this;
    }
public function halt ( HaltPropagationException $ exception = null ) { if ( $ this -> haltEvent !== "" ) { $ pointer = $ this -> middleware instanceof MiddlewareCollection ? $ this -> middleware -> current ( ) : $ this -> middleware ; $ event = $ this -> haltEvent ; if ( is_callable ( static :: $ eventCallable ) ) { static :: $ eventCallable ( new $ event ( $ pointer , $ exception ) ) ; } } if ( $ exception !== null && ! $ this -> catchHalt ) { throw $ exception ; } return $ this ; }
The method that will trigger the event and exception, if set, for halted calls.

@throws \MichaelRShelton\MiddleMan\Exceptions\HaltPropagationException

@param \MichaelRShelton\MiddleMan\Exceptions\HaltPropagationException|null $exception
@return $this
The method that will trigger the event and exception if set for halted calls .