From 9f312702892792805dda79ccc6272ff2254f6172 Mon Sep 17 00:00:00 2001 From: core23 Date: Wed, 26 Apr 2023 08:45:08 +0200 Subject: [PATCH] Fix CS --- src/Crawler/ArtistEventCrawlerInterface.php | 8 +-- src/Crawler/EventListCrawlerInterface.php | 4 +- src/Crawler/UserEventCrawlerInterface.php | 8 +-- src/Service/AlbumServiceInterface.php | 12 ++--- src/Service/ArtistServiceInterface.php | 24 ++++----- src/Service/ChartServiceInterface.php | 12 ++--- src/Service/GeoServiceInterface.php | 8 +-- src/Service/LibraryServiceInterface.php | 4 +- src/Service/TagServiceInterface.php | 24 ++++----- src/Service/TrackServiceInterface.php | 16 +++--- src/Service/UserServiceInterface.php | 60 ++++++++++----------- tests/Service/AuthServiceTest.php | 2 +- tests/Service/GeoServiceTest.php | 2 +- tests/Service/LibraryServiceTest.php | 2 +- 14 files changed, 93 insertions(+), 93 deletions(-) diff --git a/src/Crawler/ArtistEventCrawlerInterface.php b/src/Crawler/ArtistEventCrawlerInterface.php index b8df9504..38aa0a24 100644 --- a/src/Crawler/ArtistEventCrawlerInterface.php +++ b/src/Crawler/ArtistEventCrawlerInterface.php @@ -17,18 +17,18 @@ interface ArtistEventCrawlerInterface { /** - * @throws CrawlException - * * @return int[] + * + * @throws CrawlException */ public function getArtistYears(string $artist): array; /** * Get all events of an artist. * - * @throws CrawlException - * * @return Event[] + * + * @throws CrawlException */ public function getEvents(string $artist, ?int $year, int $page = 1): array; diff --git a/src/Crawler/EventListCrawlerInterface.php b/src/Crawler/EventListCrawlerInterface.php index 8b1a753f..27a54511 100644 --- a/src/Crawler/EventListCrawlerInterface.php +++ b/src/Crawler/EventListCrawlerInterface.php @@ -22,9 +22,9 @@ interface EventListCrawlerInterface * * @param int $radius in KM * - * @throws CrawlException - * * @return Event[] + * + * @throws CrawlException */ public function getEvents(GeoLocation $location, $radius = 100, int $page = 1): array; diff --git a/src/Crawler/UserEventCrawlerInterface.php b/src/Crawler/UserEventCrawlerInterface.php index a9305366..2c3c7a0d 100644 --- a/src/Crawler/UserEventCrawlerInterface.php +++ b/src/Crawler/UserEventCrawlerInterface.php @@ -17,18 +17,18 @@ interface UserEventCrawlerInterface { /** - * @throws CrawlException - * * @return int[] + * + * @throws CrawlException */ public function getUserYears(string $username): array; /** * Get all events of a user. * - * @throws CrawlException - * * @return Event[] + * + * @throws CrawlException */ public function getEvents(string $username, ?int $year, int $page = 1): array; diff --git a/src/Service/AlbumServiceInterface.php b/src/Service/AlbumServiceInterface.php index a8ef0a5f..06a05e0e 100644 --- a/src/Service/AlbumServiceInterface.php +++ b/src/Service/AlbumServiceInterface.php @@ -46,20 +46,20 @@ public function getInfo(AlbumInfoBuilder $builder): AlbumInfo; /** * Get the tags applied by an individual user to an album on Last.fm. * + * @return AlbumInfo[] + * * @throws NotFoundException * @throws ApiException - * - * @return AlbumInfo[] */ public function getTags(AlbumTagsBuilder $builder): array; /** * Get the top tags applied to an album on Last.fm. * + * @return Tag[] + * * @throws NotFoundException * @throws ApiException - * - * @return Tag[] */ public function getTopTags(AlbumTopTagsBuilder $builder): array; @@ -74,10 +74,10 @@ public function removeTag(SessionInterface $session, string $artist, string $alb /** * Search for an album by name. Returns album matches sorted by relevance. * + * @return Album[] + * * @throws NotFoundException * @throws ApiException - * - * @return Album[] */ public function search(string $album, int $limit = 50, int $page = 1): array; } diff --git a/src/Service/ArtistServiceInterface.php b/src/Service/ArtistServiceInterface.php index 04fd773c..1edfa93f 100644 --- a/src/Service/ArtistServiceInterface.php +++ b/src/Service/ArtistServiceInterface.php @@ -59,50 +59,50 @@ public function getInfo(ArtistInfoBuilder $builder): ?ArtistInfo; /** * Get all the artists similar to this artist. * + * @return Artist[] + * * @throws NotFoundException * @throws ApiException - * - * @return Artist[] */ public function getSimilar(SimilarArtistBuilder $builder): array; /** * Get the tags applied by an individual user to an artist on Last.fm. * + * @return Tag[] + * * @throws NotFoundException * @throws ApiException - * - * @return Tag[] */ public function getTags(ArtistTagsBuilder $builder): array; /** * Get the top albums for an artist on Last.fm, ordered by popularity. * + * @return Album[] + * * @throws NotFoundException * @throws ApiException - * - * @return Album[] */ public function getTopAlbums(ArtistTopAlbumsBuilder $builder): array; /** * Get the top tags for an artist on Last.fm, ordered by popularity. * + * @return Tag[] + * * @throws NotFoundException * @throws ApiException - * - * @return Tag[] */ public function getTopTags(ArtistTopTagsBuilder $builder): array; /** * Get the top tracks by an artist on Last.fm, ordered by popularity. * + * @return Song[] + * * @throws NotFoundException * @throws ApiException - * - * @return Song[] */ public function getTopTracks(ArtistTopTracksBuilder $builder): array; @@ -117,10 +117,10 @@ public function removeTag(SessionInterface $session, string $artist, string $tag /** * Search for an artist by name. Returns artist matches sorted by relevance. * + * @return Artist[] + * * @throws NotFoundException * @throws ApiException - * - * @return Artist[] */ public function search(string $artist, int $limit = 50, int $page = 1): array; } diff --git a/src/Service/ChartServiceInterface.php b/src/Service/ChartServiceInterface.php index d532e6a3..7b07bd4e 100644 --- a/src/Service/ChartServiceInterface.php +++ b/src/Service/ChartServiceInterface.php @@ -22,30 +22,30 @@ interface ChartServiceInterface /** * Get the most popular artists on Last.fm. * + * @return ArtistInfo[] + * * @throws NotFoundException * @throws ApiException - * - * @return ArtistInfo[] */ public function getTopArtists(int $limit = 50, int $page = 1): array; /** * Get the most popular tags on Last.fm last week. * + * @return Tag[] + * * @throws NotFoundException * @throws ApiException - * - * @return Tag[] */ public function getTopTags(int $limit = 50, int $page = 1): array; /** * Get the most popular tracks on Last.fm last week. * + * @return Song[] + * * @throws NotFoundException * @throws ApiException - * - * @return Song[] */ public function getTopTracks(int $limit = 50, int $page = 1): array; } diff --git a/src/Service/GeoServiceInterface.php b/src/Service/GeoServiceInterface.php index 8927d359..fff40a0e 100644 --- a/src/Service/GeoServiceInterface.php +++ b/src/Service/GeoServiceInterface.php @@ -21,10 +21,10 @@ interface GeoServiceInterface /** * Get the most popular artists on Last.fm by country. * + * @return Artist[] + * * @throws NotFoundException * @throws ApiException - * - * @return Artist[] */ public function getTopArtists(string $country, int $limit = 50, int $page = 1): array; @@ -34,10 +34,10 @@ public function getTopArtists(string $country, int $limit = 50, int $page = 1): * @param string $location * @param int $limit * + * @return Song[] + * * @throws NotFoundException * @throws ApiException - * - * @return Song[] */ public function getTopTracks(string $country, string $location = null, $limit = 50, int $page = 1): array; } diff --git a/src/Service/LibraryServiceInterface.php b/src/Service/LibraryServiceInterface.php index 7661793d..4f2ca843 100644 --- a/src/Service/LibraryServiceInterface.php +++ b/src/Service/LibraryServiceInterface.php @@ -20,10 +20,10 @@ interface LibraryServiceInterface /** * A paginated list of all the artists in a user's library, with play counts and tag counts. * + * @return AlbumInfo[] + * * @throws NotFoundException * @throws ApiException - * - * @return AlbumInfo[] */ public function getArtists(string $user, int $limit = 50, int $page = 1): array; } diff --git a/src/Service/TagServiceInterface.php b/src/Service/TagServiceInterface.php index 94e5b8f6..aa102b40 100644 --- a/src/Service/TagServiceInterface.php +++ b/src/Service/TagServiceInterface.php @@ -35,60 +35,60 @@ public function getInfo(string $tag, string $lang = null): ?TagInfo; /** * Search for tags similar to this one. Returns tags ranked by similarity, based on listening data. * + * @return Tag[] + * * @throws NotFoundException * @throws ApiException - * - * @return Tag[] */ public function getSimilar(string $tag): array; /** * Get the top albums tagged by this tag, ordered by tag count. * + * @return Album[] + * * @throws NotFoundException * @throws ApiException - * - * @return Album[] */ public function getTopAlbums(string $tag, int $limit = 50, int $page = 1): array; /** * Get the top artists tagged by this tag, ordered by tag count. * + * @return Artist[] + * * @throws NotFoundException * @throws ApiException - * - * @return Artist[] */ public function getTopArtists(string $tag, int $limit = 50, int $page = 1): array; /** * Fetches the top global tags on Last.fm, sorted by popularity (number of times used). * + * @return Tag[] + * * @throws NotFoundException * @throws ApiException - * - * @return Tag[] */ public function getTopTags(): array; /** * Get the top tracks tagged by this tag, ordered by tag count. * + * @return Song[] + * * @throws NotFoundException * @throws ApiException - * - * @return Song[] */ public function getTopTracks(string $tag, int $limit = 50, int $page = 1): array; /** * Get a list of available charts for this tag, expressed as date ranges which can be sent to the chart services. * + * @return Chart[] + * * @throws NotFoundException * @throws ApiException - * - * @return Chart[] */ public function getWeeklyChartList(string $tag): array; } diff --git a/src/Service/TrackServiceInterface.php b/src/Service/TrackServiceInterface.php index 84b235c9..7e347782 100644 --- a/src/Service/TrackServiceInterface.php +++ b/src/Service/TrackServiceInterface.php @@ -54,30 +54,30 @@ public function getInfo(TrackInfoBuilder $builder): ?SongInfo; /** * Get the similar tracks for this track on Last.fm, based on listening data. * + * @return SongInfo[] + * * @throws NotFoundException * @throws ApiException - * - * @return SongInfo[] */ public function getSimilar(SimilarTrackBuilder $builder): array; /** * Get the tags applied by an individual user to a track on Last.fm. * + * @return Tag[] + * * @throws NotFoundException * @throws ApiException - * - * @return Tag[] */ public function getTags(TrackTagsBuilder $builder): array; /** * Get the top tags for this track on Last.fm, ordered by tag count. * + * @return Tag[] + * * @throws NotFoundException * @throws ApiException - * - * @return Tag[] */ public function getTopTags(TrackTopTagsBuilder $builder): array; @@ -109,10 +109,10 @@ public function scrobble(SessionInterface $session, ScrobbeBuilder $builder): vo /** * Search for a track by track name. Returns track matches sorted by relevance. * + * @return SongInfo[] + * * @throws NotFoundException * @throws ApiException - * - * @return SongInfo[] */ public function search(string $track, int $limit = 50, int $page = 1): array; diff --git a/src/Service/UserServiceInterface.php b/src/Service/UserServiceInterface.php index 78d43d6d..414c68cd 100644 --- a/src/Service/UserServiceInterface.php +++ b/src/Service/UserServiceInterface.php @@ -28,10 +28,10 @@ interface UserServiceInterface /** * Get a list of tracks by a given artist scrobbled by this user, including scrobble time. * + * @return Song[] + * * @throws NotFoundException * @throws ApiException - * - * @return Song[] */ public function getArtistTracks(string $username, string $artist, ?RangeFilter $filter = null, int $page = 1): array; @@ -40,10 +40,10 @@ public function getArtistTracks(string $username, string $artist, ?RangeFilter $ * * @param int $limit * + * @return User[] + * * @throws NotFoundException * @throws ApiException - * - * @return User[] */ public function getFriends(string $username, bool $recenttracks = false, $limit = 50, int $page = 1): array; @@ -58,10 +58,10 @@ public function getInfo(string $username): ?User; /** * Get the last 50 tracks loved by a user. * + * @return Song[] + * * @throws NotFoundException * @throws ApiException - * - * @return Song[] */ public function getLovedTracks(string $username, int $limit = 50, int $page = 1): array; @@ -71,120 +71,120 @@ public function getLovedTracks(string $username, int $limit = 50, int $page = 1) * @param bool $extended * @param int $limit * + * @return Song[] + * * @throws NotFoundException * @throws ApiException - * - * @return Song[] */ public function getRecentTracks(string $username, ?RangeFilter $filter = null, $extended = false, $limit = 50, int $page = 1): array; /** * Get the user's personal tags. * + * @return Artist[] + * * @throws NotFoundException * @throws ApiException - * - * @return Artist[] */ public function getPersonalTagsForArtist(string $username, string $tag, int $limit = 50, int $page = 1): array; /** * Get the user's personal tags. * + * @return Album[] + * * @throws NotFoundException * @throws ApiException - * - * @return Album[] */ public function getPersonalTagsForAlbum(string $username, string $tag, int $limit = 50, int $page = 1): array; /** * Get the user's personal tags. * + * @return SongInfo[] + * * @throws NotFoundException * @throws ApiException - * - * @return SongInfo[] */ public function getPersonalTagsForTracks(string $username, string $tag, int $limit = 50, int $page = 1): array; /** * Get the top albums listened to by a user. You can stipulate a time period. Sends the overall chart by default. * + * @return Album[] + * * @throws NotFoundException * @throws ApiException - * - * @return Album[] */ public function getTopAlbums(string $username, Period $period, int $limit = 50, int $page = 1): array; /** * Get the top artists listened to by a user. You can stipulate a time period. Sends the overall chart by default. * + * @return Artist[] + * * @throws NotFoundException * @throws ApiException - * - * @return Artist[] */ public function getTopArtists(string $username, Period $period, int $limit = 50, int $page = 1): array; /** * Get the top tags used by this user. * + * @return Tag[] + * * @throws NotFoundException * @throws ApiException - * - * @return Tag[] */ public function getTopTags(string $username, int $limit = 50): array; /** * Get the top tracks listened to by a user. You can stipulate a time period. Sends the overall chart by default. * + * @return SongInfo[] + * * @throws NotFoundException * @throws ApiException - * - * @return SongInfo[] */ public function getTopTracks(string $username, Period $period, int $limit = 50, int $page = 1): array; /** * Get an album chart for a user profile, for a given date range. If no date range is supplied, it will return the most recent album chart for this user. * + * @return Album[] + * * @throws NotFoundException * @throws ApiException - * - * @return Album[] */ public function getWeeklyAlbumChart(string $username, ?RangeFilter $filter = null): array; /** * Get an artist chart for a user profile, for a given date range. If no date range is supplied, it will return the most recent artist chart for this user. * + * @return Artist[] + * * @throws NotFoundException * @throws ApiException - * - * @return Artist[] */ public function getWeeklyArtistChart(string $username, ?RangeFilter $filter = null): array; /** * Get a list of available charts for this user, expressed as date ranges which can be sent to the chart services. * + * @return Chart[] + * * @throws NotFoundException * @throws ApiException - * - * @return Chart[] */ public function getWeeklyChartList(string $username): array; /** * Get a track chart for a user profile, for a given date range. If no date range is supplied, it will return the most recent track chart for this user. * + * @return SongInfo[] + * * @throws NotFoundException * @throws ApiException - * - * @return SongInfo[] */ public function getWeeklyTrackChart(string $username, ?RangeFilter $filter = null): array; } diff --git a/tests/Service/AuthServiceTest.php b/tests/Service/AuthServiceTest.php index 908709fd..fb97b592 100644 --- a/tests/Service/AuthServiceTest.php +++ b/tests/Service/AuthServiceTest.php @@ -19,7 +19,7 @@ final class AuthServiceTest extends TestCase { /** - * @var MockObject&ApiClientInterface + * @var ApiClientInterface&MockObject */ private ApiClientInterface $client; diff --git a/tests/Service/GeoServiceTest.php b/tests/Service/GeoServiceTest.php index fb58d5b4..e3665204 100644 --- a/tests/Service/GeoServiceTest.php +++ b/tests/Service/GeoServiceTest.php @@ -19,7 +19,7 @@ final class GeoServiceTest extends TestCase { /** - * @var MockObject&ApiClientInterface + * @var ApiClientInterface&MockObject */ private ApiClientInterface $client; diff --git a/tests/Service/LibraryServiceTest.php b/tests/Service/LibraryServiceTest.php index c72208c9..9e8705ca 100644 --- a/tests/Service/LibraryServiceTest.php +++ b/tests/Service/LibraryServiceTest.php @@ -19,7 +19,7 @@ final class LibraryServiceTest extends TestCase { /** - * @var MockObject&ApiClientInterface + * @var ApiClientInterface&MockObject */ private ApiClientInterface $client;