src/Valkyrja/HttpMessage/ServerRequestFactory.php
private static function marshalHostAndPortFromHeader(stdClass $accumulator, $host): void
    {
        if (\is_array($host)) {
            $host = implode(', ', $host);
        }

        $accumulator->host = $host;
        $accumulator->port = null;

        // Works for regname, IPv4 & IPv6
        if (preg_match('|\:(\d+)$|', $accumulator->host, $matches)) {
            $accumulator->host = substr($accumulator->host, 0, -1 * (\strlen($matches[1]) + 1));
            $accumulator->port = (int) $matches[1];
        }
    }
private static function marshalHostAndPortFromHeader(stdClass $accumulator, $host): void
    {
        if (\is_array($host)) {
            $host = implode(', ', $host);
        }

        $accumulator->host = $host;
        $accumulator->port = null;

        // Works for regname, IPv4 & IPv6
        if (preg_match('|\:(\d+)$|', $accumulator->host, $matches)) {
            $accumulator->host = substr($accumulator->host, 0, -1 * (\strlen($matches[1]) + 1));
            $accumulator->port = (int) $matches[1];
        }
    }
Marshal the host and port from the request header.

@param stdClass     $accumulator
@param string|array $host

@return void