Skip to content

Commit 70db0c4

Browse files
committed
[SoapClient] Renamed proxy_user to proxy_login option to keep compatibility with SoapClient of PHP
1 parent 960c9f5 commit 70db0c4

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/BeSimple/SoapClient/Curl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ public function __construct(array $options = array(), $followLocationMaxRedirect
9090

9191
curl_setopt($this->ch, CURLOPT_PROXY, $proxyHost);
9292

93-
if ($proxyHost && isset($options['proxy_user'])) {
94-
curl_setopt($this->ch, CURLOPT_PROXYUSERPWD, $options['proxy_user'].':'.$options['proxy_pass']);
93+
if (false !== $proxyHost && isset($options['proxy_login'])) {
94+
curl_setopt($this->ch, CURLOPT_PROXYUSERPWD, $options['proxy_login'].':'.$options['proxy_password']);
9595
}
9696
}
9797

src/BeSimple/SoapClient/SoapClientBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,19 +175,19 @@ public function withDigestAuthentication($certificate, $passphrase = null)
175175
*
176176
* @param string $host Host
177177
* @param int $port Port
178-
* @param string $username Username
178+
* @param string $login Login
179179
* @param string $password Password
180180
*
181181
* @return \BeSimple\SoapClient\SoapClientBuilder
182182
*/
183-
public function withProxy($host, $port, $user = null, $pass = null)
183+
public function withProxy($host, $port, $login = null, $password = null)
184184
{
185185
$this->soapOptions['proxy_host'] = $host;
186186
$this->soapOptions['proxy_port'] = $port;
187187

188-
if ($user) {
189-
$this->soapOptions['proxy_user'] = $user;
190-
$this->soapOptions['proxy_pass'] = $pass;
188+
if ($login) {
189+
$this->soapOptions['proxy_login'] = $login;
190+
$this->soapOptions['proxy_password'] = $password;
191191
}
192192

193193
return $this;

src/BeSimple/SoapClient/Tests/SoapClientBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testWithProxy()
9595
$this->assertEquals($this->mergeOptions(array('proxy_host' => 'localhost', 'proxy_port' => 8080)), $builder->getSoapOptions());
9696

9797
$builder->withProxy('127.0.0.1', 8585, 'foo', 'bar');
98-
$this->assertEquals($this->mergeOptions(array('proxy_host' => '127.0.0.1', 'proxy_port' => 8585, 'proxy_user' => 'foo', 'proxy_pass' => 'bar')), $builder->getSoapOptions());
98+
$this->assertEquals($this->mergeOptions(array('proxy_host' => '127.0.0.1', 'proxy_port' => 8585, 'proxy_login' => 'foo', 'proxy_password' => 'bar')), $builder->getSoapOptions());
9999
}
100100

101101
public function testCreateWithDefaults()

0 commit comments

Comments
 (0)