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