Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
23 | 18 | public function __invoke(array $extensionNames): array |
|
24 | { |
||
25 | 18 | $definedSymbols = []; |
|
26 | 18 | foreach ($extensionNames as $extensionName) { |
|
27 | 17 | $extensionName = self::ALTERNATIVES[$extensionName] ?? $extensionName; |
|
28 | try { |
||
29 | 17 | $extensionReflection = new \ReflectionExtension($extensionName); |
|
30 | 16 | $definedSymbols = array_merge( |
|
31 | 16 | $definedSymbols, |
|
32 | 16 | array_keys($extensionReflection->getConstants()), |
|
33 | 16 | array_keys($extensionReflection->getFunctions()), |
|
34 | 16 | $extensionReflection->getClassNames() |
|
35 | ); |
||
36 | 1 | } catch (\Exception $e) { |
|
37 | 1 | throw new UnknownExtensionException($e->getMessage()); |
|
38 | } |
||
39 | } |
||
40 | 17 | return $definedSymbols; |
|
41 | } |
||
43 |