Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
19 | 12 | public function getPlugins() { |
|
20 | 12 | $candidates = array_filter( |
|
21 | 12 | ClassFinder::getClassesInNamespace('drupol\Yaroc\Plugin\Method'), |
|
22 | 12 | function ($className) { |
|
23 | 12 | return in_array('drupol\Yaroc\Plugin\MethodPluginInterface', class_implements($className)); |
|
24 | 12 | } |
|
25 | ); |
||
26 | |||
27 | 12 | $classes = []; |
|
28 | 12 | foreach ($candidates as $candidate) { |
|
29 | 12 | $candidate = new \ReflectionClass($candidate); |
|
30 | 12 | $candidate = $candidate->newInstance(); |
|
31 | |||
32 | 12 | $classes[$candidate::METHOD] = $candidate; |
|
33 | } |
||
34 | |||
35 | 12 | return $classes; |
|
36 | } |
||
37 | |||
56 |