Passed
Push — main ( 69b1a6...b43944 )
by Daniel
02:36
created

FeatureSetFactory::createStreamMethod()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
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 9
    public function getMethods(): array
23
    {
24
        return [
25 9
            'ping.view' => fn (): Method\V1161MethodInterface => $this->createPingMethod(),
26 9
            'getLicense.view' => fn (): Method\V1161MethodInterface => $this->createGetLicenseMethod(),
27 9
            'getAlbum.view' => fn (): Method\V1161MethodInterface => $this->createGetAlbumMethod(),
28 9
            'getArtists.view' => fn (): Method\V1161MethodInterface => $this->createGetArtistsMethod(),
29 9
            'getCoverArt.view' => fn (): Method\V1161MethodInterface => $this->createGetCoverArtMethod(),
30 9
            'getArtist.view' => fn (): Method\V1161MethodInterface => $this->createGetArtistMethod(),
31 9
            'getGenres.view' => fn (): Method\V1161MethodInterface => $this->createGetGenresMethod(),
32 9
            'getMusicFolders.view' => fn (): Method\V1161MethodInterface => $this->createGetMusicFoldersMethod(),
33 9
            'stream.view' => fn (): Method\V1161MethodInterface => $this->createStreamMethod(),
34
        ];
35
    }
36
37 1
    public function createPingMethod(): Method\V1161MethodInterface
38
    {
39 1
        return new Method\PingMethod(
40 1
            new ResponderFactory(),
41
        );
42
    }
43
44 1
    public function createGetArtistsMethod(): Method\V1161MethodInterface
45
    {
46 1
        return new Method\GetArtistsMethod(
47 1
            new ResponderFactory(),
48
        );
49
    }
50
51 1
    public function createGetLicenseMethod(): Method\V1161MethodInterface
52
    {
53 1
        return new Method\GetLicenseMethod(
54 1
            new ResponderFactory(),
55
        );
56
    }
57
58 1
    public function createGetCoverArtMethod(): Method\V1161MethodInterface
59
    {
60 1
        return new Method\GetCoverArtMethod(
61 1
            new ResponderFactory()
62
        );
63
    }
64
65 1
    public function createGetArtistMethod(): Method\V1161MethodInterface
66
    {
67 1
        return new Method\GetArtistMethod(
68 1
            new ResponderFactory()
69
        );
70
    }
71
72 1
    public function createGetGenresMethod(): Method\V1161MethodInterface
73
    {
74 1
        return new Method\GetGenresMethod(
75 1
            new ResponderFactory()
76
        );
77
    }
78
79 1
    public function createGetMusicFoldersMethod(): Method\V1161MethodInterface
80
    {
81 1
        return new Method\GetMusicFoldersMethod(
82 1
            new ResponderFactory()
83
        );
84
    }
85
86 1
    public function createGetAlbumMethod(): Method\V1161MethodInterface
87
    {
88 1
        return new Method\GetAlbumMethod(
89 1
            new ResponderFactory()
90
        );
91
    }
92
93 1
    public function createStreamMethod(): Method\V1161MethodInterface
94
    {
95 1
        return new Method\StreamMethod(
96 1
            new ResponderFactory()
97
        );
98
    }
99
}
100