Skip to content

Commit

Permalink
Add support for Twig\Markup
Browse files Browse the repository at this point in the history
  • Loading branch information
nlemoine committed Dec 20, 2024
1 parent d32bf15 commit cf43418
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions extra/html-extra/HtmlExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ public static function htmlClasses(...$args): string
if (!$condition) {
continue;
}
$classes[] = (string) $class;
$classes[] = $class;
}
} else {
throw new RuntimeError(\sprintf('The "html_classes" function argument %d should be either a string, an instance of %s or an array, got "%s".', $i, Markup::class, get_debug_type($arg)));
throw new RuntimeError(\sprintf('The "html_classes" function argument %d should be either a string or an array, got "%s".', $i, get_debug_type($arg)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
--DATA--
return []
--EXCEPTION--
Twig\Error\RuntimeError: The "html_classes" function argument 0 should be either a string, an instance of Twig\Markup or an array, got "bool" in "index.twig" at line 2.
Twig\Error\RuntimeError: The "html_classes" function argument 0 should be either a string or an array, got "bool" in "index.twig" at line 2.

0 comments on commit cf43418

Please sign in to comment.