Skip to content

Commit

Permalink
Merge pull request #120 from cerbero90/feature/php-8
Browse files Browse the repository at this point in the history
Support PHP 8
  • Loading branch information
mauricius authored Apr 30, 2021
2 parents 6adb8f6 + 8fe0607 commit 325aeaf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"authors": [],
"require": {
"php": "^7.3",
"php": "^7.3 || ^8.0",
"ext-json": "*",
"aws/aws-sdk-php-laravel": "^3.6",
"doctrine/dbal": "^3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Services/Content/MergeContentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected function mergeAutomationContent(Message $message): string

protected function mergeContent(?string $customContent, string $templateContent): string
{
return str_ireplace(['{{content}}', '{{ content }}'], $customContent, $templateContent);
return str_ireplace(['{{content}}', '{{ content }}'], $customContent ?: '', $templateContent);
}

protected function mergeTags(string $content, Message $message): string
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Content/MergeContentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function campaign_content_can_be_merged()
public function it_can_handle_a_null_value_for_campaign_content()
{
$content = null;
$message = $this->generateCampaignMessage(null, '<p>Hello this is some {{content}}</p>');
$message = $this->generateCampaignMessage($content, '<p>Hello this is some {{content}}</p>');

$mergedContent = $this->mergeContent($message);

Expand Down

0 comments on commit 325aeaf

Please sign in to comment.