Skip to content

Commit

Permalink
Add SensitiveParameter attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
natanfelles committed Dec 23, 2022
1 parent d389dda commit 0bda6fd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Framework\Email\Debug\EmailCollector;
use JetBrains\PhpStorm\ArrayShape;
use SensitiveParameter;

/**
* Class Mailer.
Expand Down Expand Up @@ -39,8 +40,8 @@ abstract class Mailer
* @param string|null $hostname
*/
public function __construct(
array | string $username,
string $password = null,
#[SensitiveParameter] array | string $username,
#[SensitiveParameter] string $password = null,
string $host = 'localhost',
int $port = 587,
string $hostname = null
Expand Down Expand Up @@ -77,7 +78,7 @@ public function __construct(
'keep_alive' => 'bool',
'add_logs' => 'bool',
])]
protected function makeConfig(array $config) : array
protected function makeConfig(#[SensitiveParameter] array $config) : array
{
return \array_replace_recursive([
'host' => 'localhost',
Expand Down

0 comments on commit 0bda6fd

Please sign in to comment.