8000 [TwigBundle] fix findTemplate() to return `null` · symfony/symfony@fc0c369 · GitHub
[go: up one dir, main page]

Skip to content

Commit fc0c369

Browse files
committed
[TwigBundle] fix findTemplate() to return null
Twig 3 expects `null` instead of `false` (see <https://github.com/twigphp/Twig/blob/3.x/src/Loader/FilesystemLoader .php#L167> and <https://github.com/twigphp/Twig/blob/a5f91f3d8fb2965be8b715323dbdc81ce288a14a/src/Loader/FilesystemLoader.php#L153> Returning `null` fixes `exists()` of Twig 3 FilesystemLoader without breaking Twig 2 (which expected `null` or `false` for not found templates).
1 parent c2427d0 commit fc0c369

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected function findTemplate($template, $throw = true)
9696
throw $twigLoaderException;
9797
}
9898

99-
return false;
99+
return null;
100100
}
101101

102102
return $this->cache[$logicalName] = $file;

0 commit comments

Comments
 (0)
0