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> |
|
|
|
|
21
|
|
|
*/ |
22
|
7 |
|
public function getMethods(): array |
23
|
|
|
{ |
24
|
|
|
return [ |
25
|
7 |
|
'ping.view' => fn (): Method\V1161MethodInterface => $this->createPingMethod(), |
26
|
7 |
|
'getLicense.view' => fn (): Method\V1161MethodInterface => $this->createGetLicenseMethod(), |
27
|
7 |
|
'getArtists.view' => fn (): Method\V1161MethodInterface => $this->createGetArtistsMethod(), |
28
|
7 |
|
'getCoverArt.view' => fn (): Method\V1161MethodInterface => $this->createGetCoverArtMethod(), |
29
|
7 |
|
'getArtist.view' => fn (): Method\V1161MethodInterface => $this->createGetArtistMethod(), |
30
|
7 |
|
'getGenres.view' => fn (): Method\V1161MethodInterface => $this->createGetGenresMethod(), |
31
|
7 |
|
'getMusicFolders.view' => fn (): Method\V1161MethodInterface => $this->createGetMusicFoldersMethod(), |
32
|
|
|
]; |
33
|
|
|
} |
34
|
|
|
|
35
|
1 |
|
public function createPingMethod(): Method\V1161MethodInterface |
36
|
|
|
{ |
37
|
1 |
|
return new Method\PingMethod( |
38
|
1 |
|
new ResponderFactory(), |
39
|
|
|
); |
40
|
|
|
} |
41
|
|
|
|
42
|
1 |
|
public function createGetArtistsMethod(): Method\V1161MethodInterface |
43
|
|
|
{ |
44
|
1 |
|
return new Method\GetArtistsMethod( |
45
|
1 |
|
new ResponderFactory(), |
46
|
|
|
); |
47
|
|
|
} |
48
|
|
|
|
49
|
1 |
|
public function createGetLicenseMethod(): Method\V1161MethodInterface |
50
|
|
|
{ |
51
|
1 |
|
return new Method\GetLicenseMethod( |
52
|
1 |
|
new ResponderFactory(), |
53
|
|
|
); |
54
|
|
|
} |
55
|
|
|
|
56
|
1 |
|
public function createGetCoverArtMethod(): Method\V1161MethodInterface |
57
|
|
|
{ |
58
|
1 |
|
return new Method\GetCoverArtMethod( |
59
|
1 |
|
new ResponderFactory() |
60
|
|
|
); |
61
|
|
|
} |
62
|
|
|
|
63
|
1 |
|
public function createGetArtistMethod(): Method\V1161MethodInterface |
64
|
|
|
{ |
65
|
1 |
|
return new Method\GetArtistMethod( |
66
|
1 |
|
new ResponderFactory() |
67
|
|
|
); |
68
|
|
|
} |
69
|
|
|
|
70
|
1 |
|
public function createGetGenresMethod(): Method\V1161MethodInterface |
71
|
|
|
{ |
72
|
1 |
|
return new Method\GetGenresMethod( |
73
|
1 |
|
new ResponderFactory() |
74
|
|
|
); |
75
|
|
|
} |
76
|
|
|
|
77
|
1 |
|
public function createGetMusicFoldersMethod(): Method\V1161MethodInterface |
78
|
|
|
{ |
79
|
1 |
|
return new Method\GetMusicFoldersMethod( |
80
|
1 |
|
new ResponderFactory() |
81
|
|
|
); |
82
|
|
|
} |
83
|
|
|
} |
84
|
|
|
|