Skip to content

Commit

Permalink
Merge pull request #23 from sroehrl/null-prevention
Browse files Browse the repository at this point in the history
Convert null to empty string in substitution to avoid deprecation err…
  • Loading branch information
sroehrl authored Jan 24, 2023
2 parents 7538a79 + 7e115b4 commit 442ea43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Interpreter.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ private function replaceVariables(array $matches, string $content): string
$lookFor = trim($pair[2]);
$substitutes = $this->handleSubstitutions($lookFor);
if(array_key_exists($lookFor, $this->flatData)){
$content = str_replace($pair[0], $this->flatData[$lookFor], $content);
$content = str_replace($pair[0], $this->flatData[$lookFor] ?? '', $content);
foreach ($substitutes as $substitute){
$content = str_replace($substitute[0], $substitute[1], $content);
}
Expand Down

0 comments on commit 442ea43

Please sign in to comment.