Skip to content

Commit

Permalink
Fixing replaceSignatureTokens(): Argument #1 ($signature) must be of …
Browse files Browse the repository at this point in the history
…type string, null given
  • Loading branch information
escopecz committed Jan 29, 2024
1 parent 829c975 commit 3639945
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/bundles/EmailBundle/Helper/FromEmailHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,15 @@ public function getSignature(): string
return '';
}

$owner = $this->lastOwner;

return $this->replaceSignatureTokens($owner['signature'], $owner);
return $this->replaceSignatureTokens($this->lastOwner);
}

/**
* @param mixed[] $owner
*/
private function replaceSignatureTokens(string $signature, array $owner): string
private function replaceSignatureTokens(array $owner): string
{
$signature = nl2br($signature);
$signature = nl2br($owner['signature'] ?? '');
$signature = str_replace('|FROM_NAME|', $owner['first_name'].' '.$owner['last_name'], $signature);

foreach ($owner as $key => $value) {
Expand Down

0 comments on commit 3639945

Please sign in to comment.