1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Everlution\AjaxcomBundle\Service; |
||
6 | |||
7 | /** |
||
8 | * Class RenderBlock. |
||
9 | * |
||
10 | * @author Ivan Barlog <[email protected]> |
||
11 | */ |
||
12 | class RenderBlock |
||
13 | { |
||
14 | /** @var \Twig_Environment */ |
||
0 ignored issues
–
show
|
|||
15 | private $twig; |
||
16 | |||
17 | public function __construct(\Twig_Environment $twig) |
||
18 | { |
||
19 | $this->twig = $twig; |
||
20 | } |
||
21 | |||
22 | public function render(string $template, string $blockId, array $parameters = []): string |
||
23 | { |
||
24 | $template = $this->twig->load($template); |
||
25 | if (false === $template->hasBlock($blockId)) { |
||
26 | throw new TemplateDoesNotContainBlock(); |
||
27 | } |
||
28 | |||
29 | $html = $template->renderBlock($blockId, $parameters); |
||
30 | if (empty($html)) { |
||
31 | throw new BlockIsEmpty(); |
||
32 | } |
||
33 | |||
34 | return $html; |
||
35 | } |
||
36 | } |
||
37 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths