getPort() 공개 메소드

public getPort ( ) : integer
리턴 integer
예제 #1
0
파일: UriTest.php 프로젝트: amphp/artax
 /**
  * @dataProvider provideUris
  */
 public function testUri($rawUri, $expectedVals)
 {
     $uri = new Uri($rawUri);
     $this->assertEquals($expectedVals['scheme'], $uri->getScheme());
     $this->assertEquals($expectedVals['host'], $uri->getHost());
     $this->assertEquals($expectedVals['user'], $uri->getUser());
     $this->assertEquals($expectedVals['pass'], $uri->getPass());
     $this->assertEquals($expectedVals['port'], $uri->getPort());
     $this->assertEquals($expectedVals['path'], $uri->getPath());
     $this->assertEquals($expectedVals['query'], $uri->getQuery());
     $this->assertEquals($expectedVals['fragment'], $uri->getFragment());
 }
예제 #2
0
 private function generateAuthorityFromUri(Uri $uri)
 {
     $scheme = $uri->getScheme();
     $host = $uri->getHost();
     $port = $uri->getPort();
     if (empty($port)) {
         $port = $scheme === 'https' ? 443 : 80;
     }
     return "{$host}:{$port}";
 }