Total Complexity | 87 |
Total Lines | 696 |
Duplicated Lines | 0 % |
Changes | 0 |
Complex classes like Blendable often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Blendable, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
14 | abstract class Blendable implements BlendableInterface |
||
15 | { |
||
16 | /** @var \modx */ |
||
|
|||
17 | protected $modx; |
||
18 | |||
19 | /** @var Blender */ |
||
20 | protected $blender; |
||
21 | |||
22 | /** @var string ~ blend or revert */ |
||
23 | protected $type = 'blend'; |
||
24 | |||
25 | /** @var string */ |
||
26 | protected $opt_cache_key = ''; |
||
27 | |||
28 | /** @var array */ |
||
29 | protected $seedCacheOptions = []; |
||
30 | |||
31 | /** @var array */ |
||
32 | protected $historyCacheOptions = []; |
||
33 | |||
34 | /** @var string */ |
||
35 | protected $seeds_dir = ''; |
||
36 | |||
37 | /** @var int $cache_life in seconds, 0 is forever */ |
||
38 | protected $cache_life = 0; |
||
39 | |||
40 | /** @var bool */ |
||
41 | protected $error = false; |
||
42 | |||
43 | /** @var array */ |
||
44 | protected $error_messages = []; |
||
45 | |||
46 | /** @var null|\xPDOSimpleObject */ |
||
47 | protected $xPDOSimpleObject = null; |
||
48 | |||
49 | /** @var string ex: modResource */ |
||
50 | protected $xpdo_simple_object_class = ''; |
||
51 | |||
52 | /** @var string */ |
||
53 | protected $unique_key_column = 'name'; |
||
54 | |||
55 | /** @var array set when a change of name/alias has been done */ |
||
56 | protected $unique_key_history = []; |
||
57 | |||
58 | /** @var array ~ this should match data to be inserted via xPDO, ex [column_name => value, ...] */ |
||
59 | protected $blendable_xpdo_simple_object_data = [ |
||
60 | 'name' => '' |
||
61 | ]; |
||
62 | |||
63 | /** @var array ~ ['setMethodName' => 'setMethodActualName', 'setDoNotUseMethod' => false] overwrite in child classes */ |
||
64 | protected $load_from_array_aliases = []; |
||
65 | |||
66 | /** @var array ~ list any fields/columns to be ignored on making seeds, like id */ |
||
67 | protected $ignore_seed_fields = ['id']; |
||
68 | |||
69 | /** @var array ~ xPDOSimpleObject->fromArray() */ |
||
70 | protected $current_xpdo_simple_object_data = []; |
||
71 | |||
72 | /** @var array */ |
||
73 | protected $related_data = []; |
||
74 | |||
75 | /** @var bool */ |
||
76 | protected $exists = false; |
||
77 | |||
78 | /** @var bool */ |
||
79 | protected $debug = false; |
||
80 | |||
81 | /** |
||
82 | * Blendable constructor. |
||
83 | * |
||
84 | * @param \modx $modx |
||
85 | * @param Blender $blender |
||
86 | * @param string|array $unique_value |
||
87 | */ |
||
88 | public function __construct(\modx $modx, Blender $blender, $unique_value = '') |
||
89 | { |
||
90 | $this->modx = $modx; |
||
91 | $this->blender = $blender; |
||
92 | if (method_exists($this, 'loadProperties')) { |
||
93 | $this->loadProperties(); |
||
94 | } |
||
95 | |||
96 | $this->seedCacheOptions = [ |
||
97 | \xPDO::OPT_CACHE_KEY => $this->opt_cache_key, |
||
98 | \xPDO::OPT_CACHE_PATH => $this->blender->getSeedsPath() |
||
99 | ]; |
||
100 | |||
101 | $this->historyCacheOptions = [ |
||
102 | \xPDO::OPT_CACHE_KEY => $this->opt_cache_key, |
||
103 | \xPDO::OPT_CACHE_PATH => $this->blender->getHistoryPath() |
||
104 | ]; |
||
105 | |||
106 | $this->setUniqueCriteria($unique_value); |
||
107 | if (!empty($unique_value)) { |
||
108 | $this->loadObject(); |
||
109 | } |
||
110 | } |
||
111 | |||
112 | /** |
||
113 | * @return bool |
||
114 | */ |
||
115 | public function isDebug() |
||
116 | { |
||
117 | return $this->debug; |
||
118 | } |
||
119 | |||
120 | /** |
||
121 | * @param bool $debug |
||
122 | * |
||
123 | * @return $this |
||
124 | */ |
||
125 | public function setDebug($debug) |
||
126 | { |
||
127 | $this->debug = $debug; |
||
128 | return $this; |
||
129 | } |
||
130 | |||
131 | /** |
||
132 | * @return string |
||
133 | */ |
||
134 | public function getSeedsDir() |
||
135 | { |
||
136 | return $this->seeds_dir; |
||
137 | } |
||
138 | |||
139 | /** |
||
140 | * @param string $dir ~ will be the directory name for seeds and history |
||
141 | * |
||
142 | * @return $this |
||
143 | */ |
||
144 | public function setSeedsDir($dir) |
||
145 | { |
||
146 | $this->seeds_dir = (string)$dir; |
||
147 | if (!empty($this->seeds_dir)) { |
||
148 | $this->seedCacheOptions[\xPDO::OPT_CACHE_PATH] = $this->blender->getSeedsPath().$dir.'/'; |
||
149 | $this->historyCacheOptions[\xPDO::OPT_CACHE_PATH] = $this->blender->getHistoryPath().$dir.'/'; |
||
150 | } |
||
151 | return $this; |
||
152 | } |
||
153 | |||
154 | /** |
||
155 | * @return bool |
||
156 | */ |
||
157 | public function isExists() |
||
158 | { |
||
159 | return $this->exists; |
||
160 | } |
||
161 | |||
162 | /** |
||
163 | * @return bool |
||
164 | */ |
||
165 | public function isError() |
||
166 | { |
||
167 | return $this->error; |
||
168 | } |
||
169 | |||
170 | /** |
||
171 | * @return array |
||
172 | */ |
||
173 | public function getErrorMessages() |
||
174 | { |
||
175 | return $this->error_messages; |
||
176 | } |
||
177 | |||
178 | /** |
||
179 | * @param string $type ~ seed or revert |
||
180 | * @return string |
||
181 | */ |
||
182 | public function getSeedKey($type = 'seed') |
||
183 | { |
||
184 | $name = $this->blendable_xpdo_simple_object_data[$this->unique_key_column]; |
||
185 | if (method_exists($this, 'getFieldName')) { |
||
186 | $name = $this->getFieldName(); |
||
187 | } |
||
188 | $key = $this->blender->getSeedKeyFromName($name); |
||
189 | |||
190 | switch ($type) { |
||
191 | case 'revert': |
||
192 | $seed_key = 'revert-'.$key; |
||
193 | break; |
||
194 | |||
195 | case 'seed': |
||
196 | // no break |
||
197 | default: |
||
198 | $seed_key = $key; |
||
199 | } |
||
200 | |||
201 | return $seed_key; |
||
202 | } |
||
203 | |||
204 | /** |
||
205 | * @return null|\xPDOSimpleObject |
||
206 | */ |
||
207 | public function getXPDOSimpleObject() |
||
210 | } |
||
211 | |||
212 | /** |
||
213 | * @param array $data ~ must be in the format: array('columns' => [], 'primaryKeyHistory' => [], 'related' => []) |
||
214 | * @param bool $overwrite |
||
215 | * @return bool |
||
216 | */ |
||
217 | public function blendFromArray($data, $overwrite = false) |
||
218 | { |
||
219 | if (isset($data['columns'])) { |
||
235 | } |
||
236 | /** |
||
237 | * @param string $seed_key |
||
238 | * @param bool $overwrite |
||
239 | * |
||
240 | * @return bool |
||
241 | * @throws BlendableException |
||
242 | */ |
||
243 | public function blendFromSeed($seed_key, $overwrite = false) |
||
247 | } |
||
248 | |||
249 | /** |
||
250 | * @param bool $overwrite |
||
251 | * |
||
252 | * @return bool |
||
253 | */ |
||
254 | public function blend($overwrite = false) |
||
255 | { |
||
256 | if ($this->type == 'blend') { |
||
257 | /** @var \LCI\Blend\Blendable\Blendable $currentVersion */ |
||
258 | $currentVersion = $this->getCurrentVersion(); |
||
259 | $currentVersion |
||
260 | ->setRelatedData($this->related_data) |
||
261 | ->makeHistory(); |
||
262 | } |
||
263 | |||
264 | $this->modx->invokeEvent( |
||
265 | 'OnBlendBeforeSave', |
||
266 | [ |
||
267 | 'blender' => $this->blender, |
||
268 | 'blendable' => $this, |
||
269 | 'data' => &$this->blendable_xpdo_simple_object_data, |
||
270 | 'type' => $this->type, |
||
271 | 'xPDOClass' => $this->xpdo_simple_object_class, |
||
272 | 'xPDOSimpleObject' => &$this->xPDOSimpleObject |
||
273 | ] |
||
274 | ); |
||
275 | |||
276 | $save = $this->save($overwrite); |
||
277 | |||
278 | if ($save) { |
||
279 | $this->modx->invokeEvent( |
||
280 | 'OnBlendAfterSave', |
||
281 | [ |
||
282 | 'blender' => $this->blender, |
||
283 | 'blendable' => $this, |
||
284 | 'data' => &$this->blendable_xpdo_simple_object_data, |
||
285 | 'type' => $this->type, |
||
286 | 'xPDOClass' => $this->xpdo_simple_object_class, |
||
287 | 'xPDOSimpleObject' => &$this->xPDOSimpleObject |
||
288 | ] |
||
289 | ); |
||
290 | } |
||
291 | |||
292 | return $save; |
||
293 | } |
||
294 | |||
295 | /** |
||
296 | * @param bool $make_revert_seed |
||
297 | * @return bool |
||
298 | */ |
||
299 | public function delete($make_revert_seed = true) |
||
300 | { |
||
301 | if ($make_revert_seed) { |
||
302 | $this->makeHistory(); |
||
303 | } |
||
304 | $removed = false; |
||
305 | if (!is_object($this->xPDOSimpleObject)) { |
||
306 | $this->blender->out($this->blendable_xpdo_simple_object_data[$this->unique_key_column].' of xPDO class '. |
||
307 | $this->xpdo_simple_object_class.' was not found, could not be removed/deleted', true); |
||
308 | |||
309 | } elseif ($this->xPDOSimpleObject->remove()) { |
||
310 | $this->onDeleteRevertRelatedPieces(); |
||
311 | if ($this->isDebug()) { |
||
312 | $this->blender->out($this->blendable_xpdo_simple_object_data[$this->unique_key_column].' has been removed/deleted'); |
||
313 | } |
||
314 | $removed = true; |
||
315 | |||
316 | } else { |
||
317 | if ($this->isDebug()) { |
||
318 | $this->blender->out($this->blendable_xpdo_simple_object_data[$this->unique_key_column].' did not remove/delete', true); |
||
319 | } |
||
320 | } |
||
321 | |||
322 | return $removed; |
||
323 | } |
||
324 | |||
325 | /** |
||
326 | * @return bool |
||
327 | */ |
||
328 | public function revertBlend() |
||
329 | { |
||
330 | $seed_key = $this->getSeedKey('revert'); |
||
331 | $this->type = 'revert'; |
||
332 | if (!$this->loadObjectDataFromHistorySeed($seed_key) || !$this->blendable_xpdo_simple_object_data) { |
||
333 | return $this->delete(false); |
||
334 | } |
||
335 | |||
336 | return $this->blend(true); |
||
337 | } |
||
338 | |||
339 | /** |
||
340 | * @return string ~ the related seed key |
||
341 | */ |
||
342 | public function seed() |
||
343 | { |
||
344 | // No IDs! must get the alias and get a seed key, |
||
345 | $seed_key = $this->getSeedKey(); |
||
346 | |||
347 | $data = $this->seedToArray('seed', $seed_key); |
||
348 | |||
349 | // now cache it: |
||
350 | $this->modx->cacheManager->set( |
||
351 | $seed_key, |
||
352 | $data, |
||
353 | $this->cache_life, |
||
354 | $this->seedCacheOptions |
||
355 | ); |
||
356 | |||
357 | return $seed_key; |
||
358 | } |
||
359 | |||
360 | /** |
||
361 | * @return string ~ the related seed key |
||
362 | */ |
||
363 | public function makeHistory() |
||
364 | { |
||
365 | $seed_key = $this->getSeedKey('revert'); |
||
366 | |||
367 | $data = $this->seedToArray('revert', $seed_key); |
||
368 | |||
369 | // now cache it: |
||
370 | $this->modx->cacheManager->set( |
||
371 | $seed_key, |
||
372 | $data, |
||
373 | $this->cache_life, |
||
374 | $this->historyCacheOptions |
||
375 | ); |
||
376 | |||
377 | return $seed_key; |
||
378 | } |
||
379 | |||
380 | /** |
||
381 | * @param string $type ~ seed or revert |
||
382 | * @param string $seed_key |
||
383 | * @return array |
||
384 | */ |
||
385 | public function seedToArray($type = 'seed', $seed_key = '') |
||
386 | { |
||
387 | if (is_object($this->xPDOSimpleObject)) { |
||
388 | $this->current_xpdo_simple_object_data = $this->xPDOSimpleObject->toArray(); |
||
389 | |||
390 | foreach ($this->current_xpdo_simple_object_data as $column => $value) { |
||
391 | if (in_array($column, $this->ignore_seed_fields)) { |
||
392 | continue; |
||
393 | } |
||
394 | // Any child class can create a seed method, an example for modResource: |
||
395 | // seedTemplate(1) and would return the string name |
||
396 | $method = 'seed'.$this->makeStudyCase($column); |
||
397 | if (method_exists($this, $method)) { |
||
398 | $value = $this->$method($value); |
||
399 | } |
||
400 | $this->blendable_xpdo_simple_object_data[$column] = $value; |
||
401 | } |
||
402 | |||
403 | $this->seedRelated($type); |
||
404 | |||
405 | $data = [ |
||
406 | 'columns' => $this->blendable_xpdo_simple_object_data, |
||
407 | 'primaryKeyHistory' => $this->unique_key_history, |
||
408 | 'related' => $this->related_data |
||
409 | ]; |
||
410 | |||
411 | } elseif ($type == 'revert') { |
||
412 | |||
413 | $data = [ |
||
414 | 'columns' => false, |
||
415 | 'primaryKeyHistory' => [], |
||
416 | 'related' => [] |
||
417 | ]; |
||
418 | |||
419 | if ($this->isDebug()) { |
||
420 | $this->blender->out('Data not found to make seed: '.$seed_key); |
||
421 | } |
||
422 | |||
423 | } elseif ($type == 'seed') { |
||
424 | if ($this->isDebug()) { |
||
425 | $this->blender->out('Data not found to make seed: '.$seed_key); |
||
426 | } |
||
427 | } |
||
428 | |||
429 | // https://docs.modx.com/revolution/2.x/developing-in-modx/other-development-resources/class-reference/modx/modx.invokeevent |
||
430 | $this->modx->invokeEvent( |
||
431 | 'OnBlendSeed', |
||
432 | [ |
||
433 | 'blender' => $this->blender, |
||
434 | 'blendable' => $this, |
||
435 | 'type' => $type, |
||
436 | 'xPDOClass' => $this->xpdo_simple_object_class, |
||
437 | 'xPDOSimpleObject' => &$this->xPDOSimpleObject, |
||
438 | 'data' => &$data |
||
439 | ] |
||
440 | ); |
||
441 | |||
442 | return $data; |
||
443 | } |
||
444 | |||
445 | /** |
||
446 | * @param bool $overwrite |
||
447 | * |
||
448 | * @return bool |
||
449 | */ |
||
450 | protected function save($overwrite = false) |
||
451 | { |
||
452 | $saved = false; |
||
453 | |||
454 | if (is_object($this->xPDOSimpleObject)) { |
||
455 | if (!$overwrite) { |
||
456 | $this->error = true; |
||
457 | $this->error_messages['exits'] = $this->xpdo_simple_object_class.': '. |
||
458 | $this->blendable_xpdo_simple_object_data[$this->unique_key_column].' already exists '; |
||
459 | return $saved; |
||
460 | } |
||
461 | } else { |
||
462 | $this->xPDOSimpleObject = $this->modx->newObject($this->xpdo_simple_object_class); |
||
463 | } |
||
464 | |||
465 | $this->xPDOSimpleObject->set($this->unique_key_column, $this->blendable_xpdo_simple_object_data[$this->unique_key_column]); |
||
466 | |||
467 | foreach ($this->blendable_xpdo_simple_object_data as $column => $value) { |
||
468 | // Any child class can create a convert method, an example for modResource: |
||
469 | // convertTemplate('String name') and would return the numeric ID |
||
470 | $method = 'convert'.$this->makeStudyCase($column); |
||
471 | if (method_exists($this, $method)) { |
||
472 | $value = $this->$method($value); |
||
473 | } |
||
474 | $this->xPDOSimpleObject->set($column, $value); |
||
475 | } |
||
476 | |||
477 | if (method_exists($this, 'getPropertiesData')) { |
||
478 | $this->xPDOSimpleObject->set('properties', $this->getPropertiesData()); |
||
479 | } |
||
480 | |||
481 | $this->attachRelatedPieces(); |
||
482 | |||
483 | if ($this->xPDOSimpleObject->save()) { |
||
484 | $this->attachRelatedPiecesAfterSave(); |
||
485 | if ($this->isDebug()) { |
||
486 | $this->blender->out($this->blendable_xpdo_simple_object_data[$this->unique_key_column].' has been installed/saved'); |
||
487 | } |
||
488 | $saved = true; |
||
489 | |||
490 | } else { |
||
491 | if ($this->isDebug()) { |
||
492 | $this->blender->out($this->blendable_xpdo_simple_object_data[$this->unique_key_column].' did not install/update', true); |
||
493 | } |
||
494 | |||
495 | } |
||
496 | |||
497 | return $saved; |
||
498 | } |
||
499 | |||
500 | protected function getUniqueCriteria() |
||
501 | { |
||
502 | return [ |
||
503 | $this->unique_key_column => $this->blendable_xpdo_simple_object_data[$this->unique_key_column] |
||
504 | ]; |
||
505 | } |
||
506 | |||
507 | /** |
||
508 | * @param string|array $criteria |
||
509 | */ |
||
510 | protected function setUniqueCriteria($criteria) |
||
511 | { |
||
512 | $this->blendable_xpdo_simple_object_data[$this->unique_key_column] = $criteria; |
||
513 | } |
||
514 | |||
515 | /** |
||
516 | * Will load an existing xPDOSimpleObject if it exists, child class needs to class this one |
||
517 | * @return $this |
||
518 | */ |
||
519 | protected function loadObject() |
||
520 | { |
||
521 | $this->xPDOSimpleObject = $this->modx->getObject($this->xpdo_simple_object_class, $this->getUniqueCriteria()); |
||
522 | |||
523 | if (is_object($this->xPDOSimpleObject)) { |
||
524 | $this->exists = true; |
||
525 | $this->current_xpdo_simple_object_data = $this->xPDOSimpleObject->toArray(); |
||
526 | $this->loadFromArray($this->current_xpdo_simple_object_data); |
||
527 | // load related data: |
||
528 | $this->loadRelatedData(); |
||
529 | } |
||
530 | |||
531 | return $this; |
||
532 | } |
||
533 | |||
534 | /** |
||
535 | * @param array $data ~ convert the db data object to blend portable data |
||
536 | * |
||
537 | * @return $this |
||
538 | */ |
||
539 | protected function loadFromArray($data = []) |
||
540 | { |
||
541 | foreach ($data as $column => $value) { |
||
542 | |||
543 | if ($column == 'content_type' && $this->xpdo_simple_object_class == 'modResource') { |
||
544 | // modResource has both contentType and content_type, ignore the 2nd |
||
545 | continue; |
||
546 | } |
||
547 | |||
548 | $method_name = 'seed'.$this->makeStudyCase($column); |
||
549 | |||
550 | if (method_exists($this, $method_name) && !is_null($value)) { |
||
551 | if ($this->isDebug()) { |
||
552 | $this->blender->out(__METHOD__.' call: '.$method_name.' V: '.$value); |
||
553 | } |
||
554 | $value = $this->$method_name($value); |
||
555 | } |
||
556 | |||
557 | $method_name = 'setField'.$this->makeStudyCase($column); |
||
558 | |||
559 | if (isset($this->load_from_array_aliases[$method_name])) { |
||
560 | $method_name = $this->load_from_array_aliases[$method_name]; |
||
561 | |||
562 | if (!$method_name) { |
||
563 | continue; |
||
564 | } |
||
565 | } |
||
566 | |||
567 | if (method_exists($this, $method_name) && !is_null($value)) { |
||
568 | if ($this->isDebug()) { |
||
569 | $this->blender->out(__METHOD__.' call: '.$method_name.' V: '.$value); |
||
570 | } |
||
571 | $this->$method_name($value); |
||
572 | |||
573 | } elseif ($this->isDebug()) { |
||
574 | $this->blender->out(__METHOD__.' missing: '.$method_name.' V: '.print_r($value, true), true); |
||
575 | } |
||
576 | } |
||
577 | |||
578 | return $this; |
||
579 | } |
||
580 | |||
581 | /** |
||
582 | * Override in child classes |
||
583 | */ |
||
584 | protected function loadRelatedData() |
||
585 | { |
||
586 | $this->modx->invokeEvent( |
||
587 | 'OnBlendLoadRelatedData', |
||
588 | [ |
||
589 | 'blender' => $this->blender, |
||
590 | 'blendable' => $this, |
||
591 | 'data' => &$this->blendable_xpdo_simple_object_data, |
||
592 | 'type' => $this->type, |
||
593 | 'xPDOClass' => $this->xpdo_simple_object_class, |
||
594 | 'xPDOSimpleObject' => &$this->xPDOSimpleObject |
||
595 | ] |
||
596 | ); |
||
597 | } |
||
598 | |||
599 | /** |
||
600 | * @param string $seed_key |
||
601 | * |
||
602 | * @return bool|array |
||
603 | * @throws BlendableException |
||
604 | */ |
||
605 | protected function loadObjectDataFromSeed($seed_key) |
||
621 | } |
||
622 | |||
623 | /** |
||
624 | * @param string $seed_key |
||
625 | * @return mixed |
||
626 | */ |
||
627 | protected function loadObjectDataFromHistorySeed($seed_key) |
||
638 | } |
||
639 | |||
640 | /** |
||
641 | * @param string $name |
||
642 | * @return string |
||
643 | */ |
||
644 | protected function makeStudyCase($name) |
||
645 | { |
||
646 | if ($name == 'templatename') { |
||
647 | $name = 'templateName'; |
||
648 | } |
||
649 | |||
650 | $StudyName = ''; |
||
651 | $parts = explode('_', $name); |
||
652 | foreach ($parts as $part) { |
||
653 | $StudyName .= ucfirst($part); |
||
654 | } |
||
655 | |||
656 | return $StudyName; |
||
657 | } |
||
658 | |||
659 | /** |
||
660 | * This method is called just before blend/save() |
||
661 | */ |
||
662 | protected function attachRelatedPieces() |
||
663 | { |
||
664 | |||
665 | } |
||
666 | |||
667 | /** |
||
668 | * This method is called just after a successful blend/save() |
||
669 | */ |
||
670 | protected function attachRelatedPiecesAfterSave() |
||
671 | { |
||
672 | |||
673 | } |
||
674 | |||
675 | /** |
||
676 | * |
||
677 | */ |
||
678 | protected function onDeleteRevertRelatedPieces() |
||
679 | { |
||
680 | |||
681 | } |
||
682 | |||
683 | /** |
||
684 | * @var string $type blend or revert |
||
685 | */ |
||
686 | protected function seedRelated($type = 'blend') |
||
690 | |||
691 | } |
||
692 | |||
693 | /** |
||
694 | * @return array |
||
695 | */ |
||
696 | public function getRelatedData() |
||
699 | } |
||
700 | |||
701 | /** |
||
702 | * @param array $data |
||
703 | * |
||
704 | * @return $this |
||
705 | */ |
||
706 | public function setRelatedData($data) |
||
710 | } |
||
711 | |||
712 | } |
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