protected static function throwOnInvalidArgument($arg, $type)
    {
        $args     = func_get_args();
        $arg      = array_shift($args);
        $arg_type = gettype($arg);
        
        $found = false;
        foreach($args as $type) {
            if ((in_array($type, self::$native_php_types) && $arg_type == $type) || $arg instanceof $type) {
                $found = true;
                break;
            }
        }
        
        if (!$found) {
            throw new Exceptions\InvalidArgumentException(
                sprintf(
                    "Argument must be of type %s.",
                    Arrays::conjunct($args, "or")
                )
            );
        }
        
        return true;
    }