1 | <?php |
||
2 | |||
3 | namespace DneCustomJsCss\Subscriber; |
||
4 | |||
5 | use Enlight\Event\SubscriberInterface; |
||
0 ignored issues
–
show
|
|||
6 | |||
7 | /** |
||
8 | * Class TemplateRegistration |
||
9 | */ |
||
10 | class TemplateRegistration implements SubscriberInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $pluginDirectory; |
||
16 | |||
17 | /** |
||
18 | * @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 ![]() |
|||
19 | */ |
||
20 | private $templateManager; |
||
21 | |||
22 | /** |
||
23 | * TemplateRegistration constructor. |
||
24 | * |
||
25 | * @param $pluginDirectory |
||
26 | * @param \Enlight_Template_Manager $templateManager |
||
27 | */ |
||
28 | public function __construct( |
||
29 | $pluginDirectory, |
||
30 | \Enlight_Template_Manager $templateManager |
||
31 | ) { |
||
32 | $this->pluginDirectory = $pluginDirectory; |
||
33 | $this->templateManager = $templateManager; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | public static function getSubscribedEvents() |
||
40 | { |
||
41 | return [ |
||
42 | 'Enlight_Controller_Action_PreDispatch' => 'onPreDispatch', |
||
43 | ]; |
||
44 | } |
||
45 | |||
46 | public function onPreDispatch() |
||
47 | { |
||
48 | $this->templateManager->addTemplateDir($this->pluginDirectory . '/Resources/views'); |
||
49 | } |
||
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