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

LiveServiceProvider::getServices()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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