| Conditions | 3 |
| Paths | 4 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 2 |
| CRAP Score | 7.2349 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 4 | public static function enable($names, $class = Manager::class) |
|
| 23 | { |
||
| 24 | 4 | $dispatcher = GeneralUtility::makeInstance(Dispatcher::class); |
|
| 25 | if (!\is_array($names)) { |
||
| 26 | $names = [$names]; |
||
| 27 | } |
||
| 28 | |||
| 29 | $trace = \debug_backtrace(false, 2); |
||
| 30 | $caller = $trace[1]['class']; |
||
| 31 | |||
| 32 | foreach ($names as $name) { |
||
| 33 | $dispatcher->connect($class, $name, $caller, 'execute'); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | } |
||
| 37 |