| Total Complexity | 4 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class ComponentServices implements Arrayable |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Component manager. |
||
| 14 | * |
||
| 15 | * @var Manager |
||
| 16 | */ |
||
| 17 | protected $manager; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Initiate Component Services. |
||
| 21 | * |
||
| 22 | * @param array $provider |
||
| 23 | */ |
||
| 24 | 2 | public function __construct(string $providerNameSpace) |
|
| 25 | { |
||
| 26 | 2 | $provider = new ReflectionClass($providerNameSpace); |
|
| 27 | |||
| 28 | 2 | $this->manager = new Manager($provider); |
|
| 29 | 1 | } |
|
| 30 | |||
| 31 | /** |
||
| 32 | * Return API collection. |
||
| 33 | * |
||
| 34 | * @return Collection |
||
| 35 | */ |
||
| 36 | 1 | public function hasApi(): Collection |
|
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Return response as collection. |
||
| 43 | * |
||
| 44 | * @return Collection |
||
| 45 | */ |
||
| 46 | 1 | public function toCollection(): Collection |
|
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Return response as array. |
||
| 53 | * |
||
| 54 | * @return array |
||
| 55 | */ |
||
| 56 | 1 | public function toArray(): array |
|
| 61 |