protected function filterPort($port)
    {
        if (empty($port)) {
            return null;
        }

        if (!self::validePort($port)) {
            throw new \InvalidArgumentException('The port is not in the TCP/UDP port.');
        }

        return $this->scheme !== '' && !$this->validPortStandard($port)
            ? (int) $port
            : null;
    }