| Total Complexity | 3 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | final readonly class ImportSchemeCollectionProvider implements ProviderInterface |
||
|
|
|||
| 18 | { |
||
| 19 | /** @param ImportApp[] $importAppConfig */ |
||
| 20 | public function __construct( |
||
| 21 | #[AppName] |
||
| 22 | private string $appName, |
||
| 23 | #[ImportAppConfig] |
||
| 24 | private array $importAppConfig, |
||
| 25 | private InjectorInterface $injector, |
||
| 26 | ) { |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * {@inheritDoc} |
||
| 31 | */ |
||
| 32 | #[Override] |
||
| 33 | public function get(): SchemeCollection |
||
| 34 | { |
||
| 35 | $schemeCollection = (new SchemeCollectionProvider($this->appName, $this->injector))->get(); |
||
| 36 | 1 | foreach ($this->importAppConfig as $importApp) { |
|
| 37 | $adapter = new AppAdapter($this->injector, $importApp->appName); |
||
| 38 | 1 | $schemeCollection |
|
| 39 | 1 | ->scheme('page')->host($importApp->host)->toAdapter($adapter) |
|
| 40 | 1 | ->scheme('app')->host($importApp->host)->toAdapter($adapter); |
|
| 41 | 1 | } |
|
| 42 | |||
| 43 | return $schemeCollection; |
||
| 44 | } |
||
| 46 |