From b0f8d4eb0f8558f39ec2991028a9f62027b48cc4 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Thu, 16 Nov 2023 11:42:55 +0300 Subject: [PATCH] Making PHPStan happy --- src/bind.inc.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/bind.inc.php b/src/bind.inc.php index 39c6a08..3eef75a 100644 --- a/src/bind.inc.php +++ b/src/bind.inc.php @@ -17,12 +17,15 @@ class BindEclLitePlugin implements \bhl_bind\BindPlugin function init(\mtgMetaInfo $meta, \Twig\Environment $twig) { $loader = $twig->getLoader(); - $loader->setPaths( - array_merge( - $loader->getPaths(), - [__DIR__ . "/../tpl"] - ) - ); + if($loader instanceof \Twig\Loader\FilesystemLoader) + { + $loader->setPaths( + array_merge( + $loader->getPaths(), + [__DIR__ . "/../tpl"] + ) + ); + } //let's collect units we're responsible for foreach($meta->getUnits() as $u)