Passed
Branch master (61095c)
by Tomáš
01:50
created

LiveServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
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 15
ccs 4
cts 4
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 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