@@ 12-73 (lines=62) @@ | ||
9 | ||
10 | namespace Core23\LastFm\Builder; |
|
11 | ||
12 | final class AlbumTopTagsBuilder |
|
13 | { |
|
14 | /** |
|
15 | * @var array |
|
16 | */ |
|
17 | private $query; |
|
18 | ||
19 | private function __construct() |
|
20 | { |
|
21 | $this->query = []; |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * @param string $artist |
|
26 | * @param string $album |
|
27 | * |
|
28 | * @return AlbumTopTagsBuilder |
|
29 | */ |
|
30 | public static function forAlbum(string $artist, string $album): self |
|
31 | { |
|
32 | $builder = new static(); |
|
33 | ||
34 | $builder->query['artist'] = $artist; |
|
35 | $builder->query['album'] = $album; |
|
36 | ||
37 | return $builder; |
|
38 | } |
|
39 | ||
40 | /** |
|
41 | * @param string $mbid |
|
42 | * |
|
43 | * @return AlbumTopTagsBuilder |
|
44 | */ |
|
45 | public static function forMbid(string $mbid): self |
|
46 | { |
|
47 | $builder = new static(); |
|
48 | ||
49 | $builder->query['mbid'] = $mbid; |
|
50 | ||
51 | return $builder; |
|
52 | } |
|
53 | ||
54 | /** |
|
55 | * @param bool $autocorrect |
|
56 | * |
|
57 | * @return AlbumTopTagsBuilder |
|
58 | */ |
|
59 | public function autocorrect(bool $autocorrect): self |
|
60 | { |
|
61 | $this->query['autocorrect'] = $autocorrect ? 1 : 0; |
|
62 | ||
63 | return $this; |
|
64 | } |
|
65 | ||
66 | /** |
|
67 | * @return array |
|
68 | */ |
|
69 | public function getQuery(): array |
|
70 | { |
|
71 | return $this->query; |
|
72 | } |
|
73 | } |
|
74 |
@@ 12-83 (lines=72) @@ | ||
9 | ||
10 | namespace Core23\LastFm\Builder; |
|
11 | ||
12 | final class ArtistTagsBuilder |
|
13 | { |
|
14 | /** |
|
15 | * @var array |
|
16 | */ |
|
17 | private $query; |
|
18 | ||
19 | private function __construct() |
|
20 | { |
|
21 | $this->query = []; |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * @param string $artist |
|
26 | * |
|
27 | * @return ArtistTagsBuilder |
|
28 | */ |
|
29 | public static function forArtist(string $artist): self |
|
30 | { |
|
31 | $builder = new static(); |
|
32 | ||
33 | $builder->query['artist'] = $artist; |
|
34 | ||
35 | return $builder; |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * @param string $mbid |
|
40 | * |
|
41 | * @return ArtistTagsBuilder |
|
42 | */ |
|
43 | public static function forMbid(string $mbid): self |
|
44 | { |
|
45 | $builder = new static(); |
|
46 | ||
47 | $builder->query['mbid'] = $mbid; |
|
48 | ||
49 | return $builder; |
|
50 | } |
|
51 | ||
52 | /** |
|
53 | * @param string $name |
|
54 | * |
|
55 | * @return ArtistTagsBuilder |
|
56 | */ |
|
57 | public function forUsername(string $name): self |
|
58 | { |
|
59 | $this->query['user'] = (int) $name; |
|
60 | ||
61 | return $this; |
|
62 | } |
|
63 | ||
64 | /** |
|
65 | * @param bool $autocorrect |
|
66 | * |
|
67 | * @return ArtistTagsBuilder |
|
68 | */ |
|
69 | public function autocorrect(bool $autocorrect): self |
|
70 | { |
|
71 | $this->query['autocorrect'] = $autocorrect ? 1 : 0; |
|
72 | ||
73 | return $this; |
|
74 | } |
|
75 | ||
76 | /** |
|
77 | * @return array |
|
78 | */ |
|
79 | public function getQuery(): array |
|
80 | { |
|
81 | return $this->query; |
|
82 | } |
|
83 | } |
|
84 |
@@ 12-71 (lines=60) @@ | ||
9 | ||
10 | namespace Core23\LastFm\Builder; |
|
11 | ||
12 | final class ArtistTopTagsBuilder |
|
13 | { |
|
14 | /** |
|
15 | * @var array |
|
16 | */ |
|
17 | private $query; |
|
18 | ||
19 | private function __construct() |
|
20 | { |
|
21 | $this->query = []; |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * @param string $artist |
|
26 | * |
|
27 | * @return ArtistTopTagsBuilder |
|
28 | */ |
|
29 | public static function forArtist(string $artist): self |
|
30 | { |
|
31 | $builder = new static(); |
|
32 | ||
33 | $builder->query['artist'] = $artist; |
|
34 | ||
35 | return $builder; |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * @param string $mbid |
|
40 | * |
|
41 | * @return ArtistTopTagsBuilder |
|
42 | */ |
|
43 | public static function forMbid(string $mbid): self |
|
44 | { |
|
45 | $builder = new static(); |
|
46 | ||
47 | $builder->query['mbid'] = $mbid; |
|
48 | ||
49 | return $builder; |
|
50 | } |
|
51 | ||
52 | /** |
|
53 | * @param bool $autocorrect |
|
54 | * |
|
55 | * @return ArtistTopTagsBuilder |
|
56 | */ |
|
57 | public function autocorrect(bool $autocorrect): self |
|
58 | { |
|
59 | $this->query['autocorrect'] = $autocorrect ? 1 : 0; |
|
60 | ||
61 | return $this; |
|
62 | } |
|
63 | ||
64 | /** |
|
65 | * @return array |
|
66 | */ |
|
67 | public function getQuery(): array |
|
68 | { |
|
69 | return $this->query; |
|
70 | } |
|
71 | } |
|
72 |
@@ 12-83 (lines=72) @@ | ||
9 | ||
10 | namespace Core23\LastFm\Builder; |
|
11 | ||
12 | final class SimilarArtistBuilder |
|
13 | { |
|
14 | /** |
|
15 | * @var array |
|
16 | */ |
|
17 | private $query; |
|
18 | ||
19 | private function __construct() |
|
20 | { |
|
21 | $this->query = []; |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * @param string $artist |
|
26 | * |
|
27 | * @return SimilarArtistBuilder |
|
28 | */ |
|
29 | public static function forArtist(string $artist): self |
|
30 | { |
|
31 | $builder = new static(); |
|
32 | ||
33 | $builder->query['artist'] = $artist; |
|
34 | ||
35 | return $builder; |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * @param string $mbid |
|
40 | * |
|
41 | * @return SimilarArtistBuilder |
|
42 | */ |
|
43 | public static function forMbid(string $mbid): self |
|
44 | { |
|
45 | $builder = new static(); |
|
46 | ||
47 | $builder->query['mbid'] = $mbid; |
|
48 | ||
49 | return $builder; |
|
50 | } |
|
51 | ||
52 | /** |
|
53 | * @param bool $autocorrect |
|
54 | * |
|
55 | * @return SimilarArtistBuilder |
|
56 | */ |
|
57 | public function autocorrect(bool $autocorrect): self |
|
58 | { |
|
59 | $this->query['autocorrect'] = $autocorrect ? 1 : 0; |
|
60 | ||
61 | return $this; |
|
62 | } |
|
63 | ||
64 | /** |
|
65 | * @param int $limit |
|
66 | * |
|
67 | * @return SimilarArtistBuilder |
|
68 | */ |
|
69 | public function limit(int $limit): self |
|
70 | { |
|
71 | $this->query['limit'] = $limit; |
|
72 | ||
73 | return $this; |
|
74 | } |
|
75 | ||
76 | /** |
|
77 | * @return array |
|
78 | */ |
|
79 | public function getQuery(): array |
|
80 | { |
|
81 | return $this->query; |
|
82 | } |
|
83 | } |
|
84 |
@@ 12-83 (lines=72) @@ | ||
9 | ||
10 | namespace Core23\LastFm\Builder; |
|
11 | ||
12 | final class TrackInfoBuilder |
|
13 | { |
|
14 | /** |
|
15 | * @var array |
|
16 | */ |
|
17 | private $query; |
|
18 | ||
19 | private function __construct() |
|
20 | { |
|
21 | $this->query = []; |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * @param string $name |
|
26 | * |
|
27 | * @return TrackInfoBuilder |
|
28 | */ |
|
29 | public static function forArtist(string $name): self |
|
30 | { |
|
31 | $builder = new static(); |
|
32 | ||
33 | $builder->query['artist'] = $name; |
|
34 | ||
35 | return $builder; |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * @param string $mbid |
|
40 | * |
|
41 | * @return TrackInfoBuilder |
|
42 | */ |
|
43 | public static function forMbid(string $mbid): self |
|
44 | { |
|
45 | $builder = new static(); |
|
46 | ||
47 | $builder->query['mbid'] = $mbid; |
|
48 | ||
49 | return $builder; |
|
50 | } |
|
51 | ||
52 | /** |
|
53 | * @param string $name |
|
54 | * |
|
55 | * @return TrackInfoBuilder |
|
56 | */ |
|
57 | public function forUsername(string $name): self |
|
58 | { |
|
59 | $this->query['username'] = (int) $name; |
|
60 | ||
61 | return $this; |
|
62 | } |
|
63 | ||
64 | /** |
|
65 | * @param bool $autocorrect |
|
66 | * |
|
67 | * @return TrackInfoBuilder |
|
68 | */ |
|
69 | public function autocorrect(bool $autocorrect): self |
|
70 | { |
|
71 | $this->query['autocorrect'] = $autocorrect ? 1 : 0; |
|
72 | ||
73 | return $this; |
|
74 | } |
|
75 | ||
76 | /** |
|
77 | * @return array |
|
78 | */ |
|
79 | public function getQuery(): array |
|
80 | { |
|
81 | return $this->query; |
|
82 | } |
|
83 | } |
|
84 |
@@ 12-73 (lines=62) @@ | ||
9 | ||
10 | namespace Core23\LastFm\Builder; |
|
11 | ||
12 | final class TrackTopTagsBuilder |
|
13 | { |
|
14 | /** |
|
15 | * @var array |
|
16 | */ |
|
17 | private $query; |
|
18 | ||
19 | private function __construct() |
|
20 | { |
|
21 | $this->query = []; |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * @param string $artist |
|
26 | * @param string $track |
|
27 | * |
|
28 | * @return TrackTopTagsBuilder |
|
29 | */ |
|
30 | public static function forTrack(string $artist, string $track): self |
|
31 | { |
|
32 | $builder = new static(); |
|
33 | ||
34 | $builder->query['artist'] = $artist; |
|
35 | $builder->query['track'] = $track; |
|
36 | ||
37 | return $builder; |
|
38 | } |
|
39 | ||
40 | /** |
|
41 | * @param string $mbid |
|
42 | * |
|
43 | * @return TrackTopTagsBuilder |
|
44 | */ |
|
45 | public static function forMbid(string $mbid): self |
|
46 | { |
|
47 | $builder = new static(); |
|
48 | ||
49 | $builder->query['mbid'] = $mbid; |
|
50 | ||
51 | return $builder; |
|
52 | } |
|
53 | ||
54 | /** |
|
55 | * @param bool $autocorrect |
|
56 | * |
|
57 | * @return TrackTopTagsBuilder |
|
58 | */ |
|
59 | public function autocorrect(bool $autocorrect): self |
|
60 | { |
|
61 | $this->query['autocorrect'] = $autocorrect ? 1 : 0; |
|
62 | ||
63 | return $this; |
|
64 | } |
|
65 | ||
66 | /** |
|
67 | * @return array |
|
68 | */ |
|
69 | public function getQuery(): array |
|
70 | { |
|
71 | return $this->query; |
|
72 | } |
|
73 | } |
|
74 |