Skip to content

Commit

Permalink
Update TwigExtension.php
Browse files Browse the repository at this point in the history
  • Loading branch information
seb-jean authored Mar 2, 2025
1 parent 5855e5c commit cc2f5ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Turbo/src/Twig/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function turboRefreshesWith(string $method = self::REFRESH_METHOD_REPLACE
public function turboRefreshMethod(string $method = self::REFRESH_METHOD_REPLACE): string
{
if (!\in_array($method, [self::REFRESH_METHOD_REPLACE, self::REFRESH_METHOD_MORPH], true)) {
throw new \InvalidArgumentException("Invalid refresh option '$method'.");
throw new \InvalidArgumentException(\sprintf('Invalid refresh option "%s".', $method));
}

return \sprintf('<meta name="turbo-refresh-method" content="%s">', $method);
Expand All @@ -79,7 +79,7 @@ public function turboRefreshMethod(string $method = self::REFRESH_METHOD_REPLACE
public function turboRefreshScroll(string $scroll = self::REFRESH_SCROLL_RESET): string
{
if (!\in_array($scroll, [self::REFRESH_SCROLL_RESET, self::REFRESH_SCROLL_PRESERVE], true)) {
throw new \InvalidArgumentException("Invalid scroll option '$scroll'.");
throw new \InvalidArgumentException(\sprintf('Invalid scroll option "%s".', $scroll));
}

return \sprintf('<meta name="turbo-refresh-scroll" content="%s">', $scroll);
Expand Down

0 comments on commit cc2f5ef

Please sign in to comment.