@@ -25,8 +25,7 @@ |
||
25 | 25 | * @param array $collection |
26 | 26 | * @param MusicBrainz $brainz |
27 | 27 | */ |
28 | - public function __construct(array $collection, MusicBrainz $brainz) |
|
29 | - { |
|
28 | + public function __construct(array $collection, MusicBrainz $brainz) { |
|
30 | 29 | $this->data = $collection; |
31 | 30 | $this->brainz = $brainz; |
32 | 31 |
@@ -33,8 +33,7 @@ discard block |
||
33 | 33 | * @param array $recording |
34 | 34 | * @param MusicBrainz $brainz |
35 | 35 | */ |
36 | - public function __construct(array $recording, MusicBrainz $brainz) |
|
37 | - { |
|
36 | + public function __construct(array $recording, MusicBrainz $brainz) { |
|
38 | 37 | $this->data = $recording; |
39 | 38 | $this->brainz = $brainz; |
40 | 39 | |
@@ -54,8 +53,7 @@ discard block |
||
54 | 53 | * |
55 | 54 | * @return $this |
56 | 55 | */ |
57 | - public function setReleases(array $releases) |
|
58 | - { |
|
56 | + public function setReleases(array $releases) { |
|
59 | 57 | foreach ($releases as $release) { |
60 | 58 | array_push($this->releases, new Release($release, $this->brainz)); |
61 | 59 | } |
@@ -66,8 +64,7 @@ discard block |
||
66 | 64 | /** |
67 | 65 | * @return int |
68 | 66 | */ |
69 | - public function getScore() |
|
70 | - { |
|
67 | + public function getScore() { |
|
71 | 68 | return $this->score; |
72 | 69 | } |
73 | 70 | |
@@ -75,8 +72,7 @@ discard block |
||
75 | 72 | * @throws Exception |
76 | 73 | * @return array |
77 | 74 | */ |
78 | - public function getReleaseDates() |
|
79 | - { |
|
75 | + public function getReleaseDates() { |
|
80 | 76 | |
81 | 77 | if (empty($this->releases)) { |
82 | 78 | throw new Exception('Could not find any releases in the recording'); |
@@ -97,16 +93,14 @@ discard block |
||
97 | 93 | /** |
98 | 94 | * @return string |
99 | 95 | */ |
100 | - public function getId() |
|
101 | - { |
|
96 | + public function getId() { |
|
102 | 97 | return $this->id; |
103 | 98 | } |
104 | 99 | |
105 | 100 | /** |
106 | 101 | * @return Artist |
107 | 102 | */ |
108 | - public function getArtist() |
|
109 | - { |
|
103 | + public function getArtist() { |
|
110 | 104 | $includes = array( |
111 | 105 | 'releases', |
112 | 106 | 'recordings', |
@@ -124,8 +118,7 @@ discard block |
||
124 | 118 | * |
125 | 119 | * @return int|string |
126 | 120 | */ |
127 | - public function getLength($format = 'int') |
|
128 | - { |
|
121 | + public function getLength($format = 'int') { |
|
129 | 122 | switch ($format) { |
130 | 123 | case 'short': |
131 | 124 | return str_replace('.', ':', number_format(($this->length / 1000 / 60), 2)); |
@@ -51,8 +51,7 @@ discard block |
||
51 | 51 | /** |
52 | 52 | * @return string |
53 | 53 | */ |
54 | - public function getEntity() |
|
55 | - { |
|
54 | + public function getEntity() { |
|
56 | 55 | return 'release'; |
57 | 56 | } |
58 | 57 | |
@@ -62,8 +61,7 @@ discard block |
||
62 | 61 | * |
63 | 62 | * @return array |
64 | 63 | */ |
65 | - public function parseResponse(array $response, MusicBrainz $brainz) |
|
66 | - { |
|
64 | + public function parseResponse(array $response, MusicBrainz $brainz) { |
|
67 | 65 | $releases = array(); |
68 | 66 | if (isset($response['release'])) { |
69 | 67 | foreach ($response['release'] as $release) { |
@@ -35,8 +35,7 @@ discard block |
||
35 | 35 | /** |
36 | 36 | * @return string |
37 | 37 | */ |
38 | - public function getEntity() |
|
39 | - { |
|
38 | + public function getEntity() { |
|
40 | 39 | return 'artist'; |
41 | 40 | } |
42 | 41 | |
@@ -46,8 +45,7 @@ discard block |
||
46 | 45 | * |
47 | 46 | * @return Artist[] |
48 | 47 | */ |
49 | - public function parseResponse(array $response, MusicBrainz $brainz) |
|
50 | - { |
|
48 | + public function parseResponse(array $response, MusicBrainz $brainz) { |
|
51 | 49 | $artists = array(); |
52 | 50 | if (isset($response['artist'])) { |
53 | 51 | foreach ($response['artist'] as $artist) { |
@@ -35,8 +35,7 @@ discard block |
||
35 | 35 | /** |
36 | 36 | * @return string |
37 | 37 | */ |
38 | - public function getEntity() |
|
39 | - { |
|
38 | + public function getEntity() { |
|
40 | 39 | return 'label'; |
41 | 40 | } |
42 | 41 | |
@@ -46,8 +45,7 @@ discard block |
||
46 | 45 | * |
47 | 46 | * @return Label[] |
48 | 47 | */ |
49 | - public function parseResponse(array $response, MusicBrainz $brainz) |
|
50 | - { |
|
48 | + public function parseResponse(array $response, MusicBrainz $brainz) { |
|
51 | 49 | $labels = array(); |
52 | 50 | |
53 | 51 | foreach ($response['labels'] as $label) { |
@@ -35,8 +35,7 @@ discard block |
||
35 | 35 | /** |
36 | 36 | * @return string |
37 | 37 | */ |
38 | - public function getEntity() |
|
39 | - { |
|
38 | + public function getEntity() { |
|
40 | 39 | return 'release-group'; |
41 | 40 | } |
42 | 41 | |
@@ -47,8 +46,7 @@ discard block |
||
47 | 46 | * @throws \MusicBrainz\Exception |
48 | 47 | * @return ReleaseGroup[] |
49 | 48 | */ |
50 | - public function parseResponse(array $response, MusicBrainz $brainz) |
|
51 | - { |
|
49 | + public function parseResponse(array $response, MusicBrainz $brainz) { |
|
52 | 50 | |
53 | 51 | if (!isset($response['release-groups'])) { |
54 | 52 | throw new Exception('No release groups found'); |
@@ -19,8 +19,7 @@ discard block |
||
19 | 19 | /** |
20 | 20 | * @return string |
21 | 21 | */ |
22 | - public function getEntity() |
|
23 | - { |
|
22 | + public function getEntity() { |
|
24 | 23 | return 'tag'; |
25 | 24 | } |
26 | 25 | |
@@ -30,8 +29,7 @@ discard block |
||
30 | 29 | * |
31 | 30 | * @return Tag[] |
32 | 31 | */ |
33 | - public function parseResponse(array $response, MusicBrainz $brainz) |
|
34 | - { |
|
32 | + public function parseResponse(array $response, MusicBrainz $brainz) { |
|
35 | 33 | $tags = array(); |
36 | 34 | foreach ($response['tags'] as $tag) { |
37 | 35 | $tags[] = new Tag($tag, $brainz); |
@@ -47,8 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * @return string |
49 | 49 | */ |
50 | - public function getEntity() |
|
51 | - { |
|
50 | + public function getEntity() { |
|
52 | 51 | return 'recording'; |
53 | 52 | } |
54 | 53 | |
@@ -59,8 +58,7 @@ discard block |
||
59 | 58 | * @throws \MusicBrainz\Exception |
60 | 59 | * @return array |
61 | 60 | */ |
62 | - public function parseResponse(array $response, MusicBrainz $brainz) |
|
63 | - { |
|
61 | + public function parseResponse(array $response, MusicBrainz $brainz) { |
|
64 | 62 | $recordings = array(); |
65 | 63 | |
66 | 64 | if (isset($response['recording'])) { |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * @param array $args |
32 | 32 | */ |
33 | - public function __construct(array $args) |
|
34 | - { |
|
33 | + public function __construct(array $args) { |
|
35 | 34 | foreach ($args as $key => $value) { |
36 | 35 | if (in_array($key, $this->validArgTypes)) { |
37 | 36 | $this->validArgs[$key] = $value; |
@@ -44,8 +43,7 @@ discard block |
||
44 | 43 | * |
45 | 44 | * @return array |
46 | 45 | */ |
47 | - public function createParameters(array $params = array()) |
|
48 | - { |
|
46 | + public function createParameters(array $params = array()) { |
|
49 | 47 | $params = $params + array('query' => ''); |
50 | 48 | |
51 | 49 | if (empty($this->validArgs) || $params['query'] != '') { |