From e8bb6aada9ee72e50919318ed70745de1318cbd8 Mon Sep 17 00:00:00 2001 From: Michael Bolli Date: Mon, 19 Nov 2018 17:44:15 +0100 Subject: [PATCH 1/2] annotate twig exceptions in fetch method --- src/Twig.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Twig.php b/src/Twig.php index 5db67b3..fbdfb58 100644 --- a/src/Twig.php +++ b/src/Twig.php @@ -79,6 +79,10 @@ public function addExtension(\Twig_ExtensionInterface $extension) * @param string $template Template pathname relative to templates directory * @param array $data Associative array of template variables * + * @throws Twig_Error_Loader When the template cannot be found + * @throws Twig_Error_Syntax When an error occurred during compilation + * @throws Twig_Error_Runtime When an error occurred during rendering + * * @return string */ public function fetch($template, $data = []) From c1db60e43ce436516bdc29af712ddf62721f32f7 Mon Sep 17 00:00:00 2001 From: Rob Allen Date: Sat, 6 Apr 2019 17:33:15 +0100 Subject: [PATCH 2/2] Update fetch() annotation to use namespaced errors --- src/Twig.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Twig.php b/src/Twig.php index fbdfb58..59ac17f 100644 --- a/src/Twig.php +++ b/src/Twig.php @@ -79,9 +79,9 @@ public function addExtension(\Twig_ExtensionInterface $extension) * @param string $template Template pathname relative to templates directory * @param array $data Associative array of template variables * - * @throws Twig_Error_Loader When the template cannot be found - * @throws Twig_Error_Syntax When an error occurred during compilation - * @throws Twig_Error_Runtime When an error occurred during rendering + * @throws \Twig\Error\LoaderError When the template cannot be found + * @throws \Twig_Error\SyntaxError When an error occurred during compilation + * @throws \Twig_Error\RuntimeError When an error occurred during rendering * * @return string */