We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0bdb34b commit 6754eb1Copy full SHA for 6754eb1
src/SoapClient.php
@@ -194,12 +194,16 @@ public function withRemoveEmptyNodes()
194
}
195
196
/**
197
- * @param string $username
198
- * @param string $password
+ * @param string|array $username
+ * @param string|null $password
199
* @return $this
200
*/
201
- public function withBasicAuth(string $username, string $password)
+ public function withBasicAuth($username, ?string $password = null)
202
{
203
+ if (is_array($username)) {
204
+ ['username' => $username, 'password' => $password] = $username;
205
+ }
206
+
207
$this->middlewares = array_merge_recursive($this->middlewares, [
208
'basic' => new BasicAuthMiddleware($username, $password),
209
]);
0 commit comments