1 | <?php |
||
2 | |||
3 | namespace DnViewSnapshots\Subscriber; |
||
4 | |||
5 | use Enlight\Event\SubscriberInterface; |
||
0 ignored issues
–
show
|
|||
6 | |||
7 | /** |
||
8 | * Class TemplateRegistration |
||
9 | * @package DnViewSnapshots\Subscriber |
||
10 | */ |
||
11 | class TemplateRegistration implements SubscriberInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | private $pluginDirectory; |
||
17 | |||
18 | /** |
||
19 | * @var \Enlight_Template_Manager |
||
0 ignored issues
–
show
The type
Enlight_Template_Manager was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
20 | */ |
||
21 | private $templateManager; |
||
22 | |||
23 | /** |
||
24 | * TemplateRegistration constructor. |
||
25 | * @param $pluginDirectory |
||
26 | * @param \Enlight_Template_Manager $templateManager |
||
27 | */ |
||
28 | public function __construct( |
||
29 | $pluginDirectory, |
||
30 | \Enlight_Template_Manager $templateManager |
||
31 | ) |
||
32 | { |
||
33 | $this->pluginDirectory = $pluginDirectory; |
||
34 | $this->templateManager = $templateManager; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | public static function getSubscribedEvents() |
||
41 | { |
||
42 | return [ |
||
43 | 'Enlight_Controller_Action_PreDispatch' => 'onPreDispatch', |
||
44 | ]; |
||
45 | } |
||
46 | |||
47 | public function onPreDispatch() |
||
48 | { |
||
49 | $this->templateManager->addTemplateDir($this->pluginDirectory . '/Resources/views'); |
||
50 | } |
||
51 | } |
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