public static function setForcedPort($port = null)
    {
        if (is_null($port)) {
            static::$forcedPort = null;

            return;
        }
        if (! is_numeric($port) || $port < 1 || $port > 65535) {
            throw new InvalidArgumentException(sprintf(
                'Invalid port provided; must be a null or a numeric between '
                . '1 and 65534; "%s" received.',
                is_numeric($port) ? $port : gettype($port)
            ));
        }
        static::$forcedPort = (int) $port;
    }