public static function isNullOrInstanceOf($value, $class, $message = null)
    {
        if (!is_null($value) && !$value instanceof $class) {
            throw new InvalidArgumentException(sprintf(
                $message ?: 'Expected null or instance of %2$s, but got %s',
                Helper::typeToString($value),
                $class
            ));
        }
    }
public static function isNullOrInstanceOf($value, $class, $message = null)
    {
        if (!is_null($value) && !$value instanceof $class) {
            throw new InvalidArgumentException(sprintf(
                $message ?: 'Expected null or instance of %2$s, but got %s',
                Helper::typeToString($value),
                $class
            ));
        }
    }
public static function isNullOrInstanceOf ( $ value , $ class , $ message = null ) { if ( ! is_null ( $ value ) && ! $ value instanceof $ class ) { throw new InvalidArgumentException ( sprintf ( $ message ? : 'Expected null or instance of %2$s, but got %s' , Helper :: typeToString ( $ value ) , $ class ) ) ; } }
Assert that the value is null or instance of class.

@param mixed  $value
@param string $class
@param string $message

@return void

@throws InvalidArgumentException
Assert that the value is null or instance of class .