proxy = $proxy; } /** * Get a configured WP Proxy URL. * * @example username:password@192.168.12.14:8080 * * @return string */ public function url(): string { if ( ! $this->proxy->is_enabled() ) { return ''; } $parts = []; if ( $this->proxy->use_authentication() ) { $parts[] = $this->proxy->authentication(); $parts[] = '@'; } $parts[] = $this->proxy->host(); $port = $this->proxy->port(); if ( strlen( $port ) ) { $parts[] = ':' . $port; } return implode( '', $parts ); } }