public function setPHPThrowable($throwable)
    {
        if (!$throwable instanceof Throwable && !$throwable instanceof Exception) {
            throw new InvalidArgumentException('The throwable must implement Throwable or extend Exception.');
        }

        $this->setName(get_class($throwable))
             ->setMessage($throwable->getMessage())
             ->setStacktrace(Stacktrace::fromBacktrace($this->config, $throwable->getTrace(), $throwable->getFile(), $throwable->getLine()));

        if (method_exists($throwable, 'getPrevious')) {
            $this->setPrevious($throwable->getPrevious());
        }

        return $this;
    }
public function setPHPThrowable($throwable)
    {
        if (!$throwable instanceof Throwable && !$throwable instanceof Exception) {
            throw new InvalidArgumentException('The throwable must implement Throwable or extend Exception.');
        }

        $this->setName(get_class($throwable))
             ->setMessage($throwable->getMessage())
             ->setStacktrace(Stacktrace::fromBacktrace($this->config, $throwable->getTrace(), $throwable->getFile(), $throwable->getLine()));

        if (method_exists($throwable, 'getPrevious')) {
            $this->setPrevious($throwable->getPrevious());
        }

        return $this;
    }
public function setPHPThrowable ( $ throwable ) { if ( ! $ throwable instanceof Throwable && ! $ throwable instanceof Exception ) { throw new InvalidArgumentException ( 'The throwable must implement Throwable or extend Exception.' ) ; } $ this -> setName ( get_class ( $ throwable ) ) -> setMessage ( $ throwable -> getMessage ( ) ) -> setStacktrace ( Stacktrace :: fromBacktrace ( $ this -> config , $ throwable -> getTrace ( ) , $ throwable -> getFile ( ) , $ throwable -> getLine ( ) ) ) ; if ( method_exists ( $ throwable , 'getPrevious' ) ) { $ this -> setPrevious ( $ throwable -> getPrevious ( ) ) ; } return $ this ; }
Set the PHP throwable.

@param \Throwable $throwable the throwable instance

@throws \InvalidArgumentException

@return $this
Set the PHP throwable .