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