Skip to content

Commit bcbfb01

Browse files
GromNaNfabpot
authored andcommitted
Hide sensitive information with SensitiveParameter attribute
1 parent 34c95d2 commit bcbfb01

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Transport/Dsn.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class Dsn
2525
private ?int $port;
2626
private array $options;
2727

28-
public function __construct(string $scheme, string $host, string $user = null, string $password = null, int $port = null, array $options = [])
28+
public function __construct(string $scheme, string $host, string $user = null, #[\SensitiveParameter] string $password = null, int $port = null, array $options = [])
2929
{
3030
$this->scheme = $scheme;
3131
$this->host = $host;

Transport/Smtp/Auth/CramMd5Authenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function authenticate(EsmtpTransport $client): void
4141
/**
4242
* Generates a CRAM-MD5 response from a server challenge.
4343
*/
44-
private function getResponse(string $secret, string $challenge): string
44+
private function getResponse(#[\SensitiveParameter] string $secret, string $challenge): string
4545
{
4646
if (\strlen($secret) > 64) {
4747
$secret = pack('H32', md5($secret));

Transport/Smtp/EsmtpTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function getUsername(): string
8383
/**
8484
* @return $this
8585
*/
86-
public function setPassword(string $password): static
86+
public function setPassword(#[\SensitiveParameter] string $password): static
8787
{
8888
$this->password = $password;
8989

0 commit comments

Comments
 (0)