Skip to content

Commit

Permalink
Fix "property" tag - ensure null is not passed to "str_replace" (oddl…
Browse files Browse the repository at this point in the history
…y not an issue < PHP 8)
  • Loading branch information
ultrono committed Dec 30, 2020
1 parent 2d52ea7 commit d215816
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Tags/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function render(string $key, $value = null, Collection $tags = null): Htm
return new HtmlString(
sprintf(
'<meta property="%s" content="%s">',
str_replace('property:', null, $key),
str_replace('property:', '', $key),
$value
)
);
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function tearDown(): void
*/
public function assertRenders(string $expected, $message = ''): void
{
self::assertStringContainsString($expected, $this->service->render(), $message);
self::assertStringContainsString($expected, $this->service::render(), $message);
}

/**
Expand All @@ -68,7 +68,7 @@ public function assertRenders(string $expected, $message = ''): void
*/
public function assertNotRenders(string $expected, $message = ''): void
{
self::assertStringNotContainsString($expected, $this->service->render(), $message);
self::assertStringNotContainsString($expected, $this->service::render(), $message);
}

/**
Expand Down

0 comments on commit d215816

Please sign in to comment.