@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | throw new InvalidArgumentException('A maximum of 10 tags is allowed'); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - array_filter($tags, static function ($tag) { |
|
| 57 | + array_filter($tags, static function($tag) { |
|
| 58 | 58 | if (null === $tag || !\is_string($tag)) { |
| 59 | 59 | throw new InvalidArgumentException(sprintf('Invalid tag given')); |
| 60 | 60 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | return ApiHelper::mapList( |
| 113 | - static function ($data) { |
|
| 113 | + static function($data) { |
|
| 114 | 114 | return SongInfo::fromApi($data); |
| 115 | 115 | }, |
| 116 | 116 | $response['similartracks']['track'] |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | return ApiHelper::mapList( |
| 132 | - static function ($data) { |
|
| 132 | + static function($data) { |
|
| 133 | 133 | return Tag::fromApi($data); |
| 134 | 134 | }, |
| 135 | 135 | $response['tags']['tag'] |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | return ApiHelper::mapList( |
| 151 | - static function ($data) { |
|
| 151 | + static function($data) { |
|
| 152 | 152 | return Tag::fromApi($data); |
| 153 | 153 | }, |
| 154 | 154 | $response['toptags']['tag'] |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | return ApiHelper::mapList( |
| 214 | - static function ($data) { |
|
| 214 | + static function($data) { |
|
| 215 | 215 | return SongInfo::fromApi($data); |
| 216 | 216 | }, |
| 217 | 217 | $response['results']['trackmatches']['track'] |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | $years = $node->filter('.content-top .secondary-nav-item-link') |
| 31 | - ->each(static function (Crawler $node) { |
|
| 31 | + ->each(static function(Crawler $node) { |
|
| 32 | 32 | return (int) trim($node->text()); |
| 33 | 33 | }) |
| 34 | 34 | ; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | return []; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - return $node->filter('.events-list-item')->each(function (Crawler $node): Event { |
|
| 53 | + return $node->filter('.events-list-item')->each(function(Crawler $node): Event { |
|
| 54 | 54 | return $this->parseEvent($node); |
| 55 | 55 | }); |
| 56 | 56 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | $resultList = []; |
| 33 | 33 | |
| 34 | - $node->filter('.page-content section')->each(function (Crawler $node) use (&$resultList) { |
|
| 34 | + $node->filter('.page-content section')->each(function(Crawler $node) use (&$resultList) { |
|
| 35 | 35 | $headingNode = $node->filter('.group-heading'); |
| 36 | 36 | |
| 37 | 37 | $datetime = new DateTime(trim($headingNode->text())); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | private function crawlEventListGroup(Crawler $node, DateTime $datetime): array |
| 72 | 72 | { |
| 73 | 73 | return $node->filter('.events-list-item')->each( |
| 74 | - function (Crawler $node) use ($datetime): Event { |
|
| 74 | + function(Crawler $node) use ($datetime): Event { |
|
| 75 | 75 | return $this->parseEvent($node, $datetime); |
| 76 | 76 | } |
| 77 | 77 | ); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | 'location_0' => 'Germany', |
| 93 | 93 | 'location_1' => $location->getLatitude(), |
| 94 | 94 | 'location_2' => $location->getLongitude(), |
| 95 | - 'radius' => $radius*1000, |
|
| 95 | + 'radius' => $radius * 1000, |
|
| 96 | 96 | 'page' => $page, |
| 97 | 97 | ]); |
| 98 | 98 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | $years = $node->filter('.content-top .secondary-nav-item-link') |
| 31 | - ->each(static function (Crawler $node) { |
|
| 31 | + ->each(static function(Crawler $node) { |
|
| 32 | 32 | return (int) trim($node->text()); |
| 33 | 33 | }) |
| 34 | 34 | ; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | return []; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - return $node->filter('.events-list-item')->each(function (Crawler $node): Event { |
|
| 53 | + return $node->filter('.events-list-item')->each(function(Crawler $node): Event { |
|
| 54 | 54 | return $this->parseEvent($node); |
| 55 | 55 | }); |
| 56 | 56 | } |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | |
| 90 | 90 | final protected function parseVenue(Crawler $node): ?Venue |
| 91 | 91 | { |
| 92 | - $title = $this->parseString($node->filter('.events-list-item-venue--title')); |
|
| 92 | + $title = $this->parseString($node->filter('.events-list-item-venue--title')); |
|
| 93 | 93 | |
| 94 | 94 | if (null === $title) { |
| 95 | 95 | return null; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | return ApiHelper::mapList( |
| 54 | - static function ($data) { |
|
| 54 | + static function($data) { |
|
| 55 | 55 | return Song::fromApi($data); |
| 56 | 56 | }, |
| 57 | 57 | $response['artisttracks']['track'] |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | return ApiHelper::mapList( |
| 75 | - static function ($data) { |
|
| 75 | + static function($data) { |
|
| 76 | 76 | return User::fromApi($data); |
| 77 | 77 | }, |
| 78 | 78 | $response['friends']['user'] |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | public function getInfo(string $username): ?User |
| 83 | 83 | { |
| 84 | - $response = $this->client->unsignedCall('user.getInfo', [ |
|
| 84 | + $response = $this->client->unsignedCall('user.getInfo', [ |
|
| 85 | 85 | 'user' => $username, |
| 86 | 86 | ]); |
| 87 | 87 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | return ApiHelper::mapList( |
| 108 | - static function ($data) { |
|
| 108 | + static function($data) { |
|
| 109 | 109 | return Song::fromApi($data); |
| 110 | 110 | }, |
| 111 | 111 | $response['lovedtracks']['track'] |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | return ApiHelper::mapList( |
| 132 | - static function ($data) { |
|
| 132 | + static function($data) { |
|
| 133 | 133 | return Song::fromApi($data); |
| 134 | 134 | }, |
| 135 | 135 | $response['recenttracks']['track'] |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | public function getPersonalTagsForArtist(string $username, string $tag, int $limit = 50, int $page = 1): array |
| 140 | 140 | { |
| 141 | - $response = $this->client->unsignedCall('user.getPersonalTags', [ |
|
| 141 | + $response = $this->client->unsignedCall('user.getPersonalTags', [ |
|
| 142 | 142 | 'taggingtype' => 'artist', |
| 143 | 143 | 'user' => $username, |
| 144 | 144 | 'tag' => $tag, |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | return ApiHelper::mapList( |
| 154 | - static function ($data) { |
|
| 154 | + static function($data) { |
|
| 155 | 155 | return Artist::fromApi($data); |
| 156 | 156 | }, |
| 157 | 157 | $response['taggings']['artists']['artist'] |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | return ApiHelper::mapList( |
| 176 | - static function ($data) { |
|
| 176 | + static function($data) { |
|
| 177 | 177 | return Album::fromApi($data); |
| 178 | 178 | }, |
| 179 | 179 | $response['taggings']['albums']['album'] |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | return ApiHelper::mapList( |
| 198 | - static function ($data) { |
|
| 198 | + static function($data) { |
|
| 199 | 199 | return SongInfo::fromApi($data); |
| 200 | 200 | }, |
| 201 | 201 | $response['taggings']['tracks']['track'] |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | return ApiHelper::mapList( |
| 219 | - static function ($data) { |
|
| 219 | + static function($data) { |
|
| 220 | 220 | return Album::fromApi($data); |
| 221 | 221 | }, |
| 222 | 222 | $response['topalbums']['album'] |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | return ApiHelper::mapList( |
| 240 | - static function ($data) { |
|
| 240 | + static function($data) { |
|
| 241 | 241 | return Artist::fromApi($data); |
| 242 | 242 | }, |
| 243 | 243 | $response['topartists']['artist'] |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | return ApiHelper::mapList( |
| 259 | - static function ($data) { |
|
| 259 | + static function($data) { |
|
| 260 | 260 | return Tag::fromApi($data); |
| 261 | 261 | }, |
| 262 | 262 | $response['toptags']['tag'] |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | return ApiHelper::mapList( |
| 280 | - static function ($data) { |
|
| 280 | + static function($data) { |
|
| 281 | 281 | return SongInfo::fromApi($data); |
| 282 | 282 | }, |
| 283 | 283 | $response['toptracks']['track'] |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | return ApiHelper::mapList( |
| 301 | - static function ($data) { |
|
| 301 | + static function($data) { |
|
| 302 | 302 | return Album::fromApi($data); |
| 303 | 303 | }, |
| 304 | 304 | $response['weeklyalbumchart']['album'] |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | return ApiHelper::mapList( |
| 322 | - static function ($data) { |
|
| 322 | + static function($data) { |
|
| 323 | 323 | return Artist::fromApi($data); |
| 324 | 324 | }, |
| 325 | 325 | $response['weeklyartistchart']['artist'] |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | return ApiHelper::mapList( |
| 340 | - static function ($data) { |
|
| 340 | + static function($data) { |
|
| 341 | 341 | return Chart::fromApi($data); |
| 342 | 342 | }, |
| 343 | 343 | $response['weeklychartlist']['chart'] |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | return ApiHelper::mapList( |
| 361 | - static function ($data) { |
|
| 361 | + static function($data) { |
|
| 362 | 362 | return SongInfo::fromApi($data); |
| 363 | 363 | }, |
| 364 | 364 | $response['weeklytrackchart']['track'] |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | throw new InvalidArgumentException('A maximum of 10 tags is allowed'); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - array_filter($tags, static function ($tag) { |
|
| 53 | + array_filter($tags, static function($tag) { |
|
| 54 | 54 | if (null === $tag || !\is_string($tag)) { |
| 55 | 55 | throw new InvalidArgumentException(sprintf('Invalid tag given')); |
| 56 | 56 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | return ApiHelper::mapList( |
| 98 | - static function ($data) { |
|
| 98 | + static function($data) { |
|
| 99 | 99 | return Artist::fromApi($data); |
| 100 | 100 | }, |
| 101 | 101 | $response['similarartists']['artist'] |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | return ApiHelper::mapList( |
| 114 | - static function ($data) { |
|
| 114 | + static function($data) { |
|
| 115 | 115 | return Tag::fromApi($data); |
| 116 | 116 | }, |
| 117 | 117 | $response['tags']['tag'] |
@@ -120,14 +120,14 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | public function getTopAlbums(ArtistTopAlbumsBuilder $builder): array |
| 122 | 122 | { |
| 123 | - $response = $this->client->unsignedCall('artist.getTopAlbums', $builder->getQuery()); |
|
| 123 | + $response = $this->client->unsignedCall('artist.getTopAlbums', $builder->getQuery()); |
|
| 124 | 124 | |
| 125 | 125 | if (!isset($response['topalbums']['album'])) { |
| 126 | 126 | return []; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | return ApiHelper::mapList( |
| 130 | - static function ($data) { |
|
| 130 | + static function($data) { |
|
| 131 | 131 | return Album::fromApi($data); |
| 132 | 132 | }, |
| 133 | 133 | $response['topalbums']['album'] |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | return ApiHelper::mapList( |
| 146 | - static function ($data) { |
|
| 146 | + static function($data) { |
|
| 147 | 147 | return Tag::fromApi($data); |
| 148 | 148 | }, |
| 149 | 149 | $response['toptags']['tag'] |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | return ApiHelper::mapList( |
| 162 | - static function ($data) { |
|
| 162 | + static function($data) { |
|
| 163 | 163 | return Song::fromApi($data); |
| 164 | 164 | }, |
| 165 | 165 | $response['toptracks']['track'] |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | return ApiHelper::mapList( |
| 190 | - static function ($data) { |
|
| 190 | + static function($data) { |
|
| 191 | 191 | return Artist::fromApi($data); |
| 192 | 192 | }, |
| 193 | 193 | $response['results']['artistmatches']['artist'] |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | |
| 48 | 48 | public function getPageBody(string $url, array $params = [], string $method = 'GET'): ?string |
| 49 | 49 | { |
| 50 | - $request = $this->createRequest($method, $url, $params); |
|
| 50 | + $request = $this->createRequest($method, $url, $params); |
|
| 51 | 51 | |
| 52 | 52 | try { |
| 53 | 53 | $response = $this->client->sendRequest($request); |