public function toHttp(int $port = null): self
    {
        if ($this->isHttp()) {
            if (null !== $port && !$this->parsedUri->portEquals($port)) {
                return new ConstructedHttpUri($this->parsedUri->transpose(['port' => $port]));
            }

            return $this;
        }

        $changes = ['scheme' => Http::SCHEME];
        if ($this->parsedUri->hasPort()) {
            $changes['port'] = $port;
        }

        return new ConstructedHttpUri($this->parsedUri->transpose($changes));
    }
public function toHttp(int $port = null): self
    {
        if ($this->isHttp()) {
            if (null !== $port && !$this->parsedUri->portEquals($port)) {
                return new ConstructedHttpUri($this->parsedUri->transpose(['port' => $port]));
            }

            return $this;
        }

        $changes = ['scheme' => Http::SCHEME];
        if ($this->parsedUri->hasPort()) {
            $changes['port'] = $port;
        }

        return new ConstructedHttpUri($this->parsedUri->transpose($changes));
    }
public function toHttp ( int $ port = null ) : self { if ( $ this -> isHttp ( ) ) { if ( null !== $ port && ! $ this -> parsedUri -> portEquals ( $ port ) ) { return new ConstructedHttpUri ( $ this -> parsedUri -> transpose ( [ 'port' => $ port ] ) ) ; } return $ this ; } $ changes = [ 'scheme' => Http :: SCHEME ] ; if ( $ this -> parsedUri -> hasPort ( ) ) { $ changes [ 'port' ] = $ port ; } return new ConstructedHttpUri ( $ this -> parsedUri -> transpose ( $ changes ) ) ; }
transposes uri to http

@param   int  $port  optional  new port to use, defaults to 80
@return  \stubbles\peer\http\HttpUri
@since   2.0.0
transposes uri to http