| Conditions | 3 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | function loadPlugin(string $pluginName): MockingStrategyInterface |
||
| 23 | { |
||
| 24 | 2 | $pluginFQCN = generateFQCN($pluginName); |
|
| 25 | |||
| 26 | if ( |
||
| 27 | 2 | !class_exists($pluginFQCN) || |
|
| 28 | 2 | !\in_array(PluginInterface::class, class_implements($pluginFQCN), true) |
|
| 29 | ) { |
||
| 30 | 1 | throw new NotImplementedException( |
|
| 31 | 1 | sprintf( |
|
| 32 | 1 | 'Mocking strategy "%s" does not exist', |
|
| 33 | 1 | $pluginName |
|
| 34 | ) |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** @var PluginInterface $pluginFQCN */ |
||
| 39 | 1 | return $pluginFQCN::getStrategy(); |
|
| 40 | } |
||
| 41 | |||
| 55 |