src/Chippyash/Validation/Exceptions/ValidationException.php
public static function assert($test, $message, $code = null)
    {
        if (!is_callable($test)) {
            throw new self('Test for assert is not callable', 500);
        }
        if ($test() === true) {
            throw new static($message, $code);
        }
    }
public static function assert($test, $message, $code = null)
    {
        if (!is_callable($test)) {
            throw new self('Test for assert is not callable', 500);
        }
        if ($test() === true) {
            throw new static($message, $code);
        }
    }
public static function assert ( $ test , $ message , $ code = null ) { if ( ! is_callable ( $ test ) ) { throw new self ( 'Test for assert is not callable' , 500 ) ; } if ( $ test ( ) === true ) { throw new static ( $ message , $ code ) ; } }
Assert a test and throw this exception if it returns true

@param callable $test    Function returning true if error condition exists
@param string   $message Message for exception
@param int      $code    Code for exception

@throws ValidationException
@throws static
Assert a test and throw this exception if it returns true