|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Nip\View\Traits; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Trait HasHelpersTrait |
|
7
|
|
|
* @package Nip\View\Traits |
|
8
|
|
|
* |
|
9
|
|
|
* @method Nip\Helpers\View\Breadcrumbs Breadcrumbs() |
|
10
|
|
|
* @method Nip\Helpers\View\Doctype Doctype() |
|
11
|
|
|
* @method Nip\Helpers\View\Flash Flash() |
|
12
|
|
|
* @method Nip\Helpers\View\FacebookMeta FacebookMeta() |
|
13
|
|
|
* @method Nip\Helpers\View\GoogleAnalytics GoogleAnalytics() |
|
14
|
|
|
* @method Nip\Helpers\View\HTML HTML() |
|
15
|
|
|
* @method Nip\Helpers\View\Messages Messages() |
|
16
|
|
|
* @method Nip\Helpers\View\Meta Meta() |
|
17
|
|
|
* @method Nip\Helpers\View\Paginator Paginator() |
|
18
|
|
|
* @method Nip\Helpers\View\Scripts Scripts() |
|
19
|
|
|
* @method Nip\Helpers\View\Stylesheets Stylesheets() |
|
20
|
|
|
* @method Nip\Helpers\View\TinyMCE TinyMCE() |
|
21
|
|
|
* @method Nip\Helpers\View\Url Url() |
|
22
|
|
|
* @method Nip\Helpers\View\GoogleDFP GoogleDFP() |
|
23
|
|
|
*/ |
|
24
|
|
|
trait HasHelpersTrait |
|
25
|
|
|
{ |
|
26
|
|
|
|
|
27
|
|
|
protected $helpers = []; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @param $name |
|
31
|
|
|
* @return mixed |
|
32
|
|
|
*/ |
|
33
|
|
|
public function getHelper($name) |
|
34
|
|
|
{ |
|
35
|
|
|
if (!isset($this->helpers[$name])) { |
|
36
|
|
|
$this->initHelper($name); |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
return $this->helpers[$name]; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @param $name |
|
44
|
|
|
*/ |
|
45
|
|
|
public function initHelper($name) |
|
46
|
|
|
{ |
|
47
|
|
|
$this->helpers[$name] = $this->newHelper($name); |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @param $name |
|
52
|
|
|
* @return Helpers\View\AbstractHelper |
|
|
|
|
|
|
53
|
|
|
*/ |
|
54
|
|
|
public function newHelper($name) |
|
55
|
|
|
{ |
|
56
|
|
|
$class = $this->getHelperClass($name); |
|
57
|
|
|
$helper = new $class(); |
|
58
|
|
|
/** @var \Nip\Helpers\View\AbstractHelper $helper */ |
|
59
|
|
|
$helper->setView($this); |
|
|
|
|
|
|
60
|
|
|
|
|
61
|
|
|
return $helper; |
|
|
|
|
|
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @param $name |
|
66
|
|
|
* @return string |
|
67
|
|
|
*/ |
|
68
|
|
|
public function getHelperClass($name) |
|
69
|
|
|
{ |
|
70
|
|
|
return '\Nip\Helpers\View\\' . $name; |
|
71
|
|
|
} |
|
72
|
|
|
} |
|
73
|
|
|
|
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