Passed
Push — main ( 157393...6183ca )
by Daniel
02:06
created

FeatureSetFactory   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
eloc 18
dl 0
loc 53
ccs 23
cts 23
cp 1
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getVersion() 0 3 1
A createGetLicenseMethod() 0 4 1
A createGetArtistMethod() 0 4 1
A createGetCoverArtMethod() 0 4 1
A getMethods() 0 8 1
A createGetArtistsMethod() 0 4 1
A createPingMethod() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Usox\HyperSonic\FeatureSet\V1161;
6
7
use Usox\HyperSonic\FeatureSet\V1161\Responder\ResponderFactory;
8
9
/**
10
 * Provides the  methods for all subsonic 1.16.1 features
11
 */
12
final class FeatureSetFactory implements FeatureSetFactoryInterface
13
{
14 1
    public function getVersion(): string
15
    {
16 1
        return '1.16.1';
17
    }
18
19
    /**
20
     * @return array<string, callable(): Method\V1161MethodInterface>
0 ignored issues
show
Documentation Bug introduced by
The doc comment array<string, callable()...d\V1161MethodInterface> at position 4 could not be parsed: Expected '>' at position 4, but found 'callable'.
Loading history...
21
     */
22 5
    public function getMethods(): array
23
    {
24
        return [
25 5
            'ping.view' => fn (): Method\V1161MethodInterface => $this->createPingMethod(),
26 5
            'getLicense.view' => fn (): Method\V1161MethodInterface => $this->createGetLicenseMethod(),
27 5
            'getArtists.view' => fn (): Method\V1161MethodInterface => $this->createGetArtistsMethod(),
28 5
            'getCoverArt.view' => fn (): Method\V1161MethodInterface => $this->createGetCoverArtMethod(),
29 5
            'getArtist.view' => fn (): Method\V1161MethodInterface => $this->createGetArtistMethod(),
30
        ];
31
    }
32
33 1
    public function createPingMethod(): Method\V1161MethodInterface
34
    {
35 1
        return new Method\PingMethod(
36 1
            new ResponderFactory(),
37
        );
38
    }
39
40 1
    public function createGetArtistsMethod(): Method\V1161MethodInterface
41
    {
42 1
        return new Method\GetArtistsMethod(
43 1
            new ResponderFactory(),
44
        );
45
    }
46
47 1
    public function createGetLicenseMethod(): Method\V1161MethodInterface
48
    {
49 1
        return new Method\GetLicenseMethod(
50 1
            new ResponderFactory(),
51
        );
52
    }
53
54 1
    public function createGetCoverArtMethod(): Method\V1161MethodInterface
55
    {
56 1
        return new Method\GetCoverArtMethod(
57 1
            new ResponderFactory()
58
        );
59
    }
60
61 1
    public function createGetArtistMethod(): Method\V1161MethodInterface
62
    {
63 1
        return new Method\GetArtistMethod(
64 1
            new ResponderFactory()
65
        );
66
    }
67
}
68