diff --git a/src/Environment.php b/src/Environment.php index 82b01d9d3..0cd5ef235 100644 --- a/src/Environment.php +++ b/src/Environment.php @@ -522,7 +522,7 @@ class Environment * @throws LoaderError When the template cannot be found * @throws SyntaxError When an error occurred during compilation */ - public function createTemplate($template, string $name = null) + public function createTemplate($template, $name = null) { $hash = hash('sha256', $template, false); if (null !== $name) { diff --git a/src/Extension/StringLoaderExtension.php b/src/Extension/StringLoaderExtension.php index 3c7400b70..295d5911c 100644 --- a/src/Extension/StringLoaderExtension.php +++ b/src/Extension/StringLoaderExtension.php @@ -47,7 +47,7 @@ use Twig\Template; * * @return Template */ -function twig_template_from_string(Environment $env, $template, string $name = null) +function twig_template_from_string(Environment $env, $template, $name = null) { return $env->createTemplate((string) $template, $name); }