GetMusicFoldersMethod   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 7 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Usox\HyperSonic\FeatureSet\V1161\Method;
6
7
use Usox\HyperSonic\Exception\SubSonicApiException;
8
use Usox\HyperSonic\FeatureSet\V1161\Contract\MusicFolderListDataProviderInterface;
9
use Usox\HyperSonic\FeatureSet\V1161\Responder\ResponderFactoryInterface;
10
use Usox\HyperSonic\Response\ResponderInterface;
11
12
/**
13
 * Retrieves the list of available music folders
14
 *
15
 * This class covers the `getMusicFolders.view` method
16
 */
17
final class GetMusicFoldersMethod implements V1161MethodInterface
18
{
19 2
    public function __construct(
20
        private readonly ResponderFactoryInterface $responderFactory,
21
    ) {
22 2
    }
23
24
    /**
25
     * @param array<string, scalar> $queryParams
26
     * @param array<string, scalar> $args
27
     *
28
     * @throws SubSonicApiException
29
     */
30 1
    public function __invoke(
31
        MusicFolderListDataProviderInterface $dataProvider,
32
        array $queryParams,
33
        array $args
34
    ): ResponderInterface {
35 1
        return $this->responderFactory->createMusicFoldersResponder(
36 1
            $dataProvider->getMusicFolders()
37 1
        );
38
    }
39
}
40