diff --git a/docs/authentication-custom.md b/docs/authentication-custom.md index 8d7d6a519..4df56f5ba 100644 --- a/docs/authentication-custom.md +++ b/docs/authentication-custom.md @@ -16,7 +16,10 @@ services that do this; perhaps this is a market waiting to be tapped?) class MySoftware_Auth_Hotdog implements WpOrg\Requests\Auth { protected $password; - public function __construct($password) { + public function __construct( + #[\SensitiveParameter] + $password + ) { $this->password = $password; } diff --git a/src/Auth/Basic.php b/src/Auth/Basic.php index 829216f82..7c5787a97 100644 --- a/src/Auth/Basic.php +++ b/src/Auth/Basic.php @@ -9,6 +9,7 @@ namespace WpOrg\Requests\Auth; +use SensitiveParameter; use WpOrg\Requests\Auth; use WpOrg\Requests\Exception\ArgumentCount; use WpOrg\Requests\Exception\InvalidArgument; @@ -48,7 +49,10 @@ class Basic implements Auth { * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not an array or null. * @throws \WpOrg\Requests\Exception\ArgumentCount On incorrect number of array elements (`authbasicbadargs`). */ - public function __construct($args = null) { + public function __construct( + #[SensitiveParameter] + $args = null + ) { if (is_array($args)) { if (count($args) !== 2) { throw ArgumentCount::create('an array with exactly two elements', count($args), 'authbasicbadargs'); diff --git a/src/Proxy/Http.php b/src/Proxy/Http.php index 2461e47ce..12c901e67 100644 --- a/src/Proxy/Http.php +++ b/src/Proxy/Http.php @@ -65,7 +65,10 @@ final class Http implements Proxy { * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not an array, a string or null. * @throws \WpOrg\Requests\Exception\ArgumentCount On incorrect number of arguments (`proxyhttpbadargs`) */ - public function __construct($args = null) { + public function __construct( + #[SensitiveParameter] + $args = null + ) { if (is_string($args)) { $this->proxy = $args; } elseif (is_array($args)) {