| Total Complexity | 2 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | final readonly class SchemeCollectionProvider implements ProviderInterface |
||
|
|
|||
| 17 | { |
||
| 18 | public function __construct( |
||
| 19 | #[AppName] |
||
| 20 | private string $appName, |
||
| 21 | private InjectorInterface $injector, |
||
| 22 | ) { |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Return instance |
||
| 27 | */ |
||
| 28 | #[Override] |
||
| 29 | public function get(): SchemeCollection |
||
| 30 | 13 | { |
|
| 31 | $schemeCollection = new SchemeCollection(); |
||
| 32 | 13 | $pageAdapter = new AppAdapter($this->injector, $this->appName); |
|
| 33 | 13 | $appAdapter = new AppAdapter($this->injector, $this->appName); |
|
| 34 | 13 | $schemeCollection->scheme('page')->host('self')->toAdapter($pageAdapter); |
|
| 35 | $schemeCollection->scheme('app')->host('self')->toAdapter($appAdapter); |
||
| 36 | $schemeCollection->scheme('http')->host('self')->toAdapter(new HttpAdapter($this->injector)); |
||
| 37 | |||
| 38 | return $schemeCollection; |
||
| 39 | } |
||
| 41 |