| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | 84 | public static function convert(array $config): BusBuilders |
|
| 13 | { |
||
| 14 | 84 | $defaultInflector = $config['method_inflector'] ?? self::DEFAULT_METHOD_INFLECTOR; |
|
| 15 | |||
| 16 | 84 | $builders = []; |
|
| 17 | 84 | foreach ($config['commandbus'] ?? [] as $busId => $busConfig) { |
|
| 18 | 84 | $builders[] = new BusBuilder( |
|
| 19 | 84 | $busId, |
|
| 20 | 84 | $busConfig['method_inflector'] ?? $defaultInflector, |
|
| 21 | 84 | $busConfig['middleware'] |
|
| 22 | ); |
||
| 23 | } |
||
| 24 | |||
| 25 | 84 | return new BusBuilders($builders, $config['default_bus'] ?? self::DEFAULT_BUS_ID); |
|
| 26 | } |
||
| 27 | } |
||
| 28 |