Skip to content

Commit bdc90e9

Browse files
committed
PHP: use SensitiveParameter annotation
1 parent 36fc43a commit bdc90e9

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

src/Client.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ public function __construct(HttpPluginClientBuilder $httpClientBuilder = null, $
4848
* @param string $key
4949
* @param string $secret
5050
*/
51-
public function authenticate($key, $secret)
52-
{
51+
public function authenticate(
52+
#[\SensitiveParameter]
53+
$key,
54+
#[\SensitiveParameter]
55+
$secret
56+
) {
5357
$this->httpClientBuilder->removePlugin(RequestSignature::class);
5458
$this->httpClientBuilder->addPlugin(new RequestSignature($key, $secret));
5559
}

src/HttpClient/Plugin/RequestSignature.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ class RequestSignature implements Plugin
2525
* @param string $key
2626
* @param string $secret
2727
*/
28-
public function __construct($key, $secret)
29-
{
28+
public function __construct(
29+
#[\SensitiveParameter]
30+
$key,
31+
#[\SensitiveParameter]
32+
$secret
33+
) {
3034
if (!$key || !$secret) {
3135
throw new \InvalidArgumentException('$key and $secret must be set');
3236
}

src/WebhookSignature.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ class WebhookSignature
1414
/** @var string */
1515
private $secret;
1616

17-
public function __construct($secret)
18-
{
17+
public function __construct(
18+
#[\SensitiveParameter]
19+
$secret
20+
) {
1921
$this->secret = $secret;
2022
}
2123

0 commit comments

Comments
 (0)