diff --git a/src/Plugin.php b/src/Plugin.php index fae4db09..765c4d1c 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -86,9 +86,9 @@ public function __invoke(RegistrationInterface $api, SimpleXMLElement $config = $api->addStubFile($stubFilePath); } - if(isset($config->twigCachePath)) { - static::$twig_cache_path = getcwd() . DIRECTORY_SEPARATOR . ltrim((string) $config->twigCachePath, DIRECTORY_SEPARATOR); - if(!is_dir(static::$twig_cache_path) || !is_readable(static::$twig_cache_path)) { + if (isset($config->twigCachePath)) { + static::$twig_cache_path = getcwd().DIRECTORY_SEPARATOR.ltrim((string) $config->twigCachePath, DIRECTORY_SEPARATOR); + if (!is_dir(static::$twig_cache_path) || !is_readable(static::$twig_cache_path)) { throw new ConfigException(sprintf('The twig directory %s is missing or not readable.', static::$twig_cache_path)); }