marshalHostAndPort() public static method

Marshal the host and port from HTTP headers and/or the PHP environment
Deprecation: as of 0.7.0; use marshalHostAndPortFromHeaders() instead.
public static marshalHostAndPort ( stdClass $accumulator, array $server, Psr\Http\Message\MessageInterface $request ) : array
$accumulator stdClass
$server array
$request Psr\Http\Message\MessageInterface
return array Array with two members, host and port, at indices 0 and 1, respectively
 public function testMarshalHostAndPortWillDetectPortInIpv6StyleHost()
 {
     $request = new ServerRequest();
     $request = $request->withUri(new Uri('http://example.com/'));
     $server = ['SERVER_ADDR' => 'FE80::0202:B3FF:FE1E:8329', 'SERVER_NAME' => '[FE80::0202:B3FF:FE1E:8329:80]'];
     $accumulator = (object) ['host' => '', 'port' => null];
     ServerRequestFactory::marshalHostAndPort($accumulator, $server, $request);
     $this->assertEquals('[FE80::0202:B3FF:FE1E:8329]', $accumulator->host);
     $this->assertEquals(80, $accumulator->port);
 }