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