| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | 1 | protected function getPluginName(object $plugin): string |
|
| 38 | { |
||
| 39 | // TODO: Create interface for plugin naming |
||
| 40 | 1 | if (method_exists($plugin, 'name')) { |
|
| 41 | 1 | return $plugin->name(); |
|
| 42 | } |
||
| 43 | |||
| 44 | 1 | $pluginName = \get_class($plugin); |
|
| 45 | 1 | if (class_exists($pluginName)) { |
|
| 46 | 1 | $exploded = explode('\\', $pluginName); |
|
| 47 | |||
| 48 | 1 | return array_pop($exploded); |
|
| 49 | } |
||
| 50 | |||
| 51 | return $pluginName; |
||
| 52 | } |
||
| 54 |