This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Arrilot\BitrixBlade; |
||
4 | |||
5 | use Illuminate\Container\Container; |
||
6 | use Illuminate\Events\Dispatcher; |
||
7 | use Illuminate\Filesystem\Filesystem; |
||
8 | use Illuminate\View\Engines\CompilerEngine; |
||
9 | use Illuminate\View\Engines\EngineResolver; |
||
10 | use Illuminate\View\Engines\PhpEngine; |
||
11 | use Illuminate\View\Factory; |
||
12 | |||
13 | class Blade |
||
14 | { |
||
15 | /** |
||
16 | * Array of view base directories. |
||
17 | * |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $viewPaths; |
||
21 | |||
22 | /** |
||
23 | * Local path to blade cache storage. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $cachePath; |
||
28 | |||
29 | /** |
||
30 | * Service container instance. |
||
31 | * |
||
32 | * @var Container |
||
33 | */ |
||
34 | protected $container; |
||
35 | |||
36 | /** |
||
37 | * View factory instance. |
||
38 | * |
||
39 | * @var Factory |
||
40 | */ |
||
41 | protected $viewFactory; |
||
42 | |||
43 | /** |
||
44 | * Constructor. |
||
45 | * |
||
46 | * @param array $viewPaths |
||
47 | * @param string $cachePath |
||
48 | * @param Container $container |
||
49 | */ |
||
50 | public function __construct($viewPaths = [], $cachePath, $container) |
||
51 | { |
||
52 | $this->viewPaths = $viewPaths; |
||
53 | $this->cachePath = $cachePath; |
||
54 | $this->container = $container; |
||
55 | |||
56 | $this->registerFilesystem(); |
||
57 | $this->registerEvents(); |
||
58 | $this->registerEngineResolver(); |
||
59 | $this->registerViewFinder(); |
||
60 | $this->registerFactory(); |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * Getter for view factory. |
||
65 | * |
||
66 | * @return Factory |
||
67 | */ |
||
68 | public function view() |
||
69 | { |
||
70 | return $this->viewFactory; |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * Register filesystem in container. |
||
75 | * |
||
76 | * @return void |
||
77 | */ |
||
78 | public function registerFilesystem() |
||
79 | { |
||
80 | $this->container->singleton('files', function () { |
||
81 | return new Filesystem(); |
||
82 | }); |
||
83 | } |
||
84 | |||
85 | /** |
||
86 | * Register events in container. |
||
87 | * |
||
88 | * @return void |
||
89 | */ |
||
90 | public function registerEvents() |
||
91 | { |
||
92 | $this->container->singleton('events', function () { |
||
93 | return new Dispatcher(); |
||
94 | }); |
||
95 | } |
||
96 | |||
97 | /** |
||
98 | * Register the engine resolver instance. |
||
99 | * |
||
100 | * @return void |
||
101 | */ |
||
102 | public function registerEngineResolver() |
||
103 | { |
||
104 | $me = $this; |
||
105 | |||
106 | $this->container->singleton('view.engine.resolver', function () use ($me) { |
||
107 | $resolver = new EngineResolver(); |
||
108 | |||
109 | $me->registerPhpEngine($resolver); |
||
110 | $me->registerBladeEngine($resolver); |
||
111 | |||
112 | return $resolver; |
||
113 | }); |
||
114 | } |
||
115 | |||
116 | /** |
||
117 | * Register the PHP engine implementation. |
||
118 | * |
||
119 | * @param EngineResolver $resolver |
||
120 | * |
||
121 | * @return void |
||
122 | */ |
||
123 | public function registerPhpEngine($resolver) |
||
124 | { |
||
125 | $resolver->register('php', function () { |
||
126 | return new PhpEngine(); |
||
127 | }); |
||
128 | } |
||
129 | |||
130 | /** |
||
131 | * Register the Blade engine implementation. |
||
132 | * |
||
133 | * @param EngineResolver $resolver |
||
134 | * |
||
135 | * @return void |
||
136 | */ |
||
137 | public function registerBladeEngine($resolver) |
||
138 | { |
||
139 | $me = $this; |
||
140 | $app = $this->container; |
||
141 | |||
142 | $this->container->singleton('blade.compiler', function ($app) use ($me) { |
||
143 | $cache = $me->cachePath; |
||
144 | |||
145 | return new BladeCompiler($app['files'], $cache); |
||
146 | }); |
||
147 | |||
148 | $resolver->register('blade', function () use ($app) { |
||
149 | return new CompilerEngine($app['blade.compiler'], $app['files']); |
||
0 ignored issues
–
show
|
|||
150 | }); |
||
151 | } |
||
152 | |||
153 | /** |
||
154 | * Register the view factory. |
||
155 | */ |
||
156 | public function registerFactory() |
||
157 | { |
||
158 | $resolver = $this->container['view.engine.resolver']; |
||
159 | |||
160 | $finder = $this->container['view.finder']; |
||
161 | |||
162 | $factory = new Factory($resolver, $finder, $this->container['events']); |
||
163 | $factory->setContainer($this->container); |
||
164 | |||
165 | //$factory->share('app', $this->container); |
||
166 | $this->viewFactory = $factory; |
||
167 | } |
||
168 | |||
169 | /** |
||
170 | * Register the view finder implementation. |
||
171 | * |
||
172 | * @return void |
||
173 | */ |
||
174 | public function registerViewFinder() |
||
175 | { |
||
176 | $me = $this; |
||
177 | $this->container->singleton('view.finder', function ($app) use ($me) { |
||
178 | $paths = $me->viewPaths; |
||
179 | |||
180 | return new ViewFinder($app['files'], $paths); |
||
181 | }); |
||
182 | } |
||
183 | } |
||
184 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.