diff --git a/lib/Twig/Cache/Filesystem.php b/lib/Twig/Cache/Filesystem.php index 188a46ed5..01922bb58 100644 --- a/lib/Twig/Cache/Filesystem.php +++ b/lib/Twig/Cache/Filesystem.php @@ -24,8 +24,8 @@ class Twig_Cache_Filesystem implements CacheInterface private $options; /** - * @param $directory string The root cache directory - * @param $options int A set of options + * @param string $directory The root cache directory + * @param int $options A set of options */ public function __construct($directory, $options = 0) { diff --git a/lib/Twig/Environment.php b/lib/Twig/Environment.php index 49ce30d9c..bd5674f0b 100644 --- a/lib/Twig/Environment.php +++ b/lib/Twig/Environment.php @@ -518,13 +518,12 @@ class Twig_Environment try { return $this->loadTemplate($name); } catch (LoaderError $e) { + if (1 === \count($names)) { + throw $e; + } } } - if (1 === \count($names)) { - throw $e; - } - throw new LoaderError(sprintf('Unable to find one of the following templates: "%s".', implode('", "', $names))); }