Passed
Branch master (61095c)
by Tomáš
01:50
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 readonly SettingService $settingService,
15
    ) {
16 2
    }
17
18
    /**
19
     * @return array<string>
20
     *
21
     * @throws \Inspirum\Balikobot\Exception\Exception
22
     */
23 2
    public function getServices(string $carrier): array
24
    {
25 2
        return array_map(static fn(Service $service): string => $service->getType(), $this->settingService->getServices($carrier)->getServices());
26
    }
27
}
28