allow null replacement character

Cette révision appartient à :
Daniel Seifert 2024-12-23 15:12:00 +01:00
Parent c631f9a6ac
révision dad34c0b61

Voir le fichier

@ -12,7 +12,7 @@ class sensitiveMessageFormatter extends MessageFormatter
public function __construct(
?string $template = self::CLF,
protected array $anonymizations = [],
protected string $replaceChar = '*'
protected ?string $replaceChar = null
) {
$this->createReplacements($this->anonymizations);
@ -22,6 +22,7 @@ class sensitiveMessageFormatter extends MessageFormatter
protected function createReplacements(array $search = []): void
{
$replacements = [];
$this->replaceChar = $this->replaceChar ?? '*';
array_map(
function ($search) use (&$replacements) {