public function doesNotThrow(string $unexpectedType = null): self
    {
        increaseAssertionCounter(1);
        $this->runCode();
        if (null !== $this->exception
                && (null === $unexpectedType || $this->exception instanceof $unexpectedType)) {
            throw new AssertionFailure(
                    'Failed asserting that no exception'
                    . (null !== $unexpectedType
                        ? ' of type "' . $unexpectedType . '"'
                        : ''
                    )
                    . ' is thrown, got ' . get_class($this->exception)
                    . ' with message "' . $this->exception->getMessage() . '".'
            );
        }

        return $this;
    }
public function doesNotThrow(string $unexpectedType = null): self
    {
        increaseAssertionCounter(1);
        $this->runCode();
        if (null !== $this->exception
                && (null === $unexpectedType || $this->exception instanceof $unexpectedType)) {
            throw new AssertionFailure(
                    'Failed asserting that no exception'
                    . (null !== $unexpectedType
                        ? ' of type "' . $unexpectedType . '"'
                        : ''
                    )
                    . ' is thrown, got ' . get_class($this->exception)
                    . ' with message "' . $this->exception->getMessage() . '".'
            );
        }

        return $this;
    }
public function doesNotThrow ( string $ unexpectedType = null ) : self { increaseAssertionCounter ( 1 ) ; $ this -> runCode ( ) ; if ( null !== $ this -> exception && ( null === $ unexpectedType || $ this -> exception instanceof $ unexpectedType ) ) { throw new AssertionFailure ( 'Failed asserting that no exception' . ( null !== $ unexpectedType ? ' of type "' . $ unexpectedType . '"' : '' ) . ' is thrown, got ' . get_class ( $ this -> exception ) . ' with message "' . $ this -> exception -> getMessage ( ) . '".' ) ; } return $ this ; }
asserts that code does not throw an exception when executed

If no expected type is given the code is not allowed to throw any
exception.

@api
@param   string  $unexpectedType  optional  type of exception which should not be thrown
@return  \bovigo\assert\Expectation
@throws  \bovigo\assert\AssertionFailure
asserts that code does not throw an exception when executed