Passed
Branch master (0d8fc3)
by Tomáš
12:26
created

LiveServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 11
ccs 3
cts 3
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getServices() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Inspirum\Balikobot\Provider;
6
7
use Inspirum\Balikobot\Model\Service\Service;
8
use Inspirum\Balikobot\Service\SettingService;
9
use function array_map;
10
11
final class LiveServiceProvider implements ServiceProvider
12
{
13 2
    public function __construct(
14
        private SettingService $settingService,
15
    ) {
16
    }
17
18
    /** @inheritDoc */
19 2
    public function getServices(string $carrier): array
20
    {
21 2
        return array_map(static fn(Service $service): string => $service->getType(), $this->settingService->getServices($carrier)->getServices());
22
    }
23
}
24