Total Complexity | 9 |
Total Lines | 80 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | trait HasViewTrait |
||
13 | { |
||
14 | /** |
||
15 | * @var null|ViewInterface |
||
16 | */ |
||
17 | protected $view = null; |
||
18 | |||
19 | protected $layout = '/layouts/email'; |
||
20 | |||
21 | /** |
||
22 | * @return string |
||
23 | */ |
||
24 | public function getLayout() |
||
25 | { |
||
26 | return $this->layout; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @param string $layout |
||
31 | */ |
||
32 | public function setLayout($layout) |
||
33 | { |
||
34 | $this->layout = $layout; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @return null|string |
||
39 | */ |
||
40 | protected function generateEmailBody() |
||
41 | { |
||
42 | $this->compileView(); |
||
43 | return $this->getView()->load($this->layout, [], true); |
||
44 | } |
||
45 | |||
46 | protected function compileView() |
||
47 | { |
||
48 | // $this->getView()->title = $this->getEmail()->subject; |
||
49 | // $this->getView()->content = $this->getEmail()->body; |
||
50 | $this->getView()->setBlock('content', '/emails/notifications'); |
||
51 | $this->getView()->set('content', $this->generateEmailContent()); |
||
52 | $this->getView()->set('title', $this->getEmail()->subject); |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @return ViewInterface |
||
57 | */ |
||
58 | public function getView() |
||
59 | { |
||
60 | if ($this->view === null) { |
||
61 | $this->initView(); |
||
62 | } |
||
63 | |||
64 | return $this->view; |
||
65 | } |
||
66 | |||
67 | public function initView() |
||
68 | { |
||
69 | $this->view = $this->newView(); |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * @param ViewInterface $view |
||
74 | */ |
||
75 | public function setView($view) |
||
78 | } |
||
79 | |||
80 | /** |
||
81 | * @return DefaultView |
||
82 | */ |
||
83 | public function newView() |
||
86 | } |
||
87 | |||
88 | /** |
||
89 | * @return null|string |
||
90 | */ |
||
91 | abstract protected function generateEmailContent(); |
||
92 | } |
||
93 |
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