| Conditions | 2 |
| Paths | 2 |
| Total Lines | 21 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 1 | public function register(): void |
|
| 24 | { |
||
| 25 | /** @var Config $config */ |
||
| 26 | 1 | $config = $this->getContainer()->get(Config::class); |
|
| 27 | |||
| 28 | /** @var array $intents */ |
||
| 29 | 1 | $intents = $config->get('intents', []); |
|
| 30 | |||
| 31 | /** @var string $fallbackIntent */ |
||
| 32 | 1 | $fallbackIntent = $config->get('fallback_intent', FallbackIntent::class); |
|
| 33 | |||
| 34 | 1 | $manager = new IntentManager(); |
|
| 35 | |||
| 36 | 1 | foreach ($intents as $intent) { |
|
| 37 | 1 | $manager->add($this->getContainer()->get($intent)); |
|
| 38 | } |
||
| 39 | |||
| 40 | 1 | $manager->setFallbackIntent($this->getContainer()->get($fallbackIntent)); |
|
| 41 | |||
| 42 | 1 | $this->getContainer()->add(IntentManager::class, $manager); |
|
| 43 | 1 | } |
|
| 44 | } |
||
| 45 |