Phly\Http\ServerRequestFactory::marshalIpv6HostAndPort PHP Method

marshalIpv6HostAndPort() private static method

Marshal host/port from misinterpreted IPv6 address
private static marshalIpv6HostAndPort ( stdClass $accumulator, array $server )
$accumulator stdClass
$server array
    private static function marshalIpv6HostAndPort(stdClass $accumulator, array $server)
    {
        $accumulator->host = '[' . $server['SERVER_ADDR'] . ']';
        $accumulator->port = $accumulator->port ?: 80;
        if ($accumulator->port . ']' == substr($accumulator->host, strrpos($accumulator->host, ':') + 1)) {
            // The last digit of the IPv6-Address has been taken as port
            // Unset the port so the default port can be used
            $accumulator->port = null;
        }
    }