Phly\Http\Uri::withScheme PHP Метод

withScheme() публичный Метод

public withScheme ( $scheme )
    public function withScheme($scheme)
    {
        $scheme = $this->filterScheme($scheme);
        if ($scheme === $this->scheme) {
            // Do nothing if no change was made.
            return clone $this;
        }
        $new = clone $this;
        $new->scheme = $scheme;
        return $new;
    }

Usage Example

Пример #1
0
 /**
  * @dataProvider invalidSchemes
  */
 public function testMutatingWithUnsupportedSchemeRaisesAnException($scheme)
 {
     $uri = new Uri('http://example.com');
     $this->setExpectedException('InvalidArgumentException', 'Unsupported scheme');
     $uri->withScheme($scheme);
 }
All Usage Examples Of Phly\Http\Uri::withScheme