Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Dec 3, 2023
1 parent d6ad326 commit c5cdb41
Show file tree
Hide file tree
Showing 47 changed files with 197 additions and 216 deletions.
124 changes: 62 additions & 62 deletions phpstan-baseline.neon

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="3.12.1@9b860214d58c48b5cbe99bdb17914d0eb723c9cd">
<file src="tests/bootstrap.php">
<UnresolvableInclude occurrences="1">
<code>require_once current($files)</code>
</UnresolvableInclude>
</file>
</files>
<files psalm-version="5.16.0@2897ba636551a8cb61601cc26f6ccfbba6c36591"/>
4 changes: 2 additions & 2 deletions src/Builder/AlbumInfoBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()

public static function forAlbum(string $artist, string $album): self
{
$builder = new static();
$builder = new self();

$builder->query['artist'] = $artist;
$builder->query['album'] = $album;
Expand All @@ -32,7 +32,7 @@ public static function forAlbum(string $artist, string $album): self

public static function forMbid(string $mbid): self
{
$builder = new static();
$builder = new self();

$builder->query['mbid'] = $mbid;

Expand Down
4 changes: 2 additions & 2 deletions src/Builder/AlbumTagsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()

public static function forAlbum(string $artist, string $album): self
{
$builder = new static();
$builder = new self();

$builder->query['artist'] = $artist;
$builder->query['album'] = $album;
Expand All @@ -32,7 +32,7 @@ public static function forAlbum(string $artist, string $album): self

public static function forMbid(string $mbid): self
{
$builder = new static();
$builder = new self();

$builder->query['mbid'] = $mbid;

Expand Down
4 changes: 2 additions & 2 deletions src/Builder/AlbumTopTagsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()

public static function forAlbum(string $artist, string $album): self
{
$builder = new static();
$builder = new self();

$builder->query['artist'] = $artist;
$builder->query['album'] = $album;
Expand All @@ -32,7 +32,7 @@ public static function forAlbum(string $artist, string $album): self

public static function forMbid(string $mbid): self
{
$builder = new static();
$builder = new self();

$builder->query['mbid'] = $mbid;

Expand Down
4 changes: 2 additions & 2 deletions src/Builder/ArtistInfoBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()

public static function forArtist(string $artist): self
{
$builder = new static();
$builder = new self();

$builder->query['artist'] = $artist;

Expand All @@ -31,7 +31,7 @@ public static function forArtist(string $artist): self

public static function forMbid(string $mbid): self
{
$builder = new static();
$builder = new self();

$builder->query['mbid'] = $mbid;

Expand Down
4 changes: 2 additions & 2 deletions src/Builder/ArtistTagsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()

public static function forArtist(string $artist): self
{
$builder = new static();
$builder = new self();

$builder->query['artist'] = $artist;

Expand All @@ -31,7 +31,7 @@ public static function forArtist(string $artist): self

public static function forMbid(string $mbid): self
{
$builder = new static();
$builder = new self();

$builder->query['mbid'] = $mbid;

Expand Down
4 changes: 2 additions & 2 deletions src/Builder/ArtistTopAlbumsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()

public static function forArtist(string $artist): self
{
$builder = new static();
$builder = new self();

$builder->query['artist'] = $artist;

Expand All @@ -31,7 +31,7 @@ public static function forArtist(string $artist): self

public static function forMbid(string $mbid): self
{
$builder = new static();
$builder = new self();

$builder->query['mbid'] = $mbid;

Expand Down
4 changes: 2 additions & 2 deletions src/Builder/ArtistTopTagsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()

public static function forArtist(string $artist): self
{
$builder = new static();
$builder = new self();

$builder->query['artist'] = $artist;

Expand All @@ -31,7 +31,7 @@ public static function forArtist(string $artist): self

public static function forMbid(string $mbid): self
{
$builder = new static();
$builder = new self();

$builder->query['mbid'] = $mbid;

Expand Down
4 changes: 2 additions & 2 deletions src/Builder/ArtistTopTracksBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()

public static function forArtist(string $artist): self
{
$builder = new static();
$builder = new self();

$builder->query['artist'] = $artist;

Expand All @@ -31,7 +31,7 @@ public static function forArtist(string $artist): self

public static function forMbid(string $mbid): self
{
$builder = new static();
$builder = new self();

$builder->query['mbid'] = $mbid;

Expand Down
2 changes: 1 addition & 1 deletion src/Builder/ScrobbeBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()

public static function create(): self
{
return new static();
return new self();
}

public function addTrack(TrackBuilder $builder): self
Expand Down
4 changes: 2 additions & 2 deletions src/Builder/SimilarArtistBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()

public static function forArtist(string $artist): self
{
$builder = new static();
$builder = new self();

$builder->query['artist'] = $artist;

Expand All @@ -31,7 +31,7 @@ public static function forArtist(string $artist): self

public static function forMbid(string $mbid): self
{
$builder = new static();
$builder = new self();

$builder->query['mbid'] = $mbid;

Expand Down
4 changes: 2 additions & 2 deletions src/Builder/SimilarTrackBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()

public static function forTrack(string $artist, string $track): self
{
$builder = new static();
$builder = new self();

$builder->query['artist'] = $artist;
$builder->query['track'] = $track;
Expand All @@ -32,7 +32,7 @@ public static function forTrack(string $artist, string $track): self

public static function forMbid(string $mbid): self
{
$builder = new static();
$builder = new self();

$builder->query['mbid'] = $mbid;

Expand Down
2 changes: 1 addition & 1 deletion src/Builder/TrackBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private function __construct(array $data)

public static function create(string $artist, string $track, DateTime $date): self
{
return new static([
return new self([
'artist' => $artist,
'track' => $track,
'timestamp' => $date->getTimestamp(),
Expand Down
4 changes: 2 additions & 2 deletions src/Builder/TrackInfoBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()

public static function forArtist(string $name): self
{
$builder = new static();
$builder = new self();

$builder->query['artist'] = $name;

Expand All @@ -31,7 +31,7 @@ public static function forArtist(string $name): self

public static function forMbid(string $mbid): self
{
$builder = new static();
$builder = new self();

$builder->query['mbid'] = $mbid;

Expand Down
4 changes: 2 additions & 2 deletions src/Builder/TrackTagsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()

public static function forTrack(string $artist, string $track): self
{
$builder = new static();
$builder = new self();

$builder->query['artist'] = $artist;
$builder->query['track'] = $track;
Expand All @@ -32,7 +32,7 @@ public static function forTrack(string $artist, string $track): self

public static function forMbid(string $mbid): self
{
$builder = new static();
$builder = new self();

$builder->query['mbid'] = $mbid;

Expand Down
4 changes: 2 additions & 2 deletions src/Builder/TrackTopTagsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function __construct()

public static function forTrack(string $artist, string $track): self
{
$builder = new static();
$builder = new self();

$builder->query['artist'] = $artist;
$builder->query['track'] = $track;
Expand All @@ -32,7 +32,7 @@ public static function forTrack(string $artist, string $track): self

public static function forMbid(string $mbid): self
{
$builder = new static();
$builder = new self();

$builder->query['mbid'] = $mbid;

Expand Down
2 changes: 1 addition & 1 deletion src/Connection/ConnectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface ConnectionInterface
/**
* Calls the API.
*
*@throws ApiException
* @throws ApiException
*/
public function call(string $url, array $params = [], string $method = 'GET'): array;

Expand Down
3 changes: 0 additions & 3 deletions src/Crawler/AbstractCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ final protected function crawl(string $url, array $params = []): ?Crawler
return null;
}

/**
* @param DateTimeImmutable $datetime
*/
final protected function parseEvent(Crawler $node, DateTimeImmutable $datetime = null): Event
{
$eventNode = $node->filter('.events-list-item-event--title a');
Expand Down
2 changes: 1 addition & 1 deletion src/Crawler/EventListCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function (Crawler $node) use ($datetime): Event {

private function crawlUrl(GeoLocation $location, int $radius, int $page = 1): ?Crawler
{
$url = static::BASE_URL;
$url = self::BASE_URL;

return $this->crawl($url, [
'location_0' => 'Germany',
Expand Down
4 changes: 1 addition & 3 deletions src/Exception/CrawlException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@

use Exception;

final class CrawlException extends Exception
{
}
final class CrawlException extends Exception {}
4 changes: 1 addition & 3 deletions src/Exception/NotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@

use Exception;

final class NotFoundException extends Exception
{
}
final class NotFoundException extends Exception {}
3 changes: 0 additions & 3 deletions src/Model/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ public function getEventDate(): DateTimeImmutable
return $this->eventDate;
}

/**
* @return string
*/
public function getUrl(): ?string
{
return $this->url;
Expand Down
3 changes: 1 addition & 2 deletions src/Service/GeoServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public function getTopArtists(string $country, int $limit = 50, int $page = 1):
/**
* Get the most popular tracks on Last.fm last week by country.
*
* @param string $location
* @param int $limit
* @param int $limit
*
* @return Song[]
*
Expand Down
2 changes: 0 additions & 2 deletions src/Service/TagServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ interface TagServiceInterface
/**
* Get the metadata for a tag on Last.fm. Includes biography.
*
* @param string $lang
*
* @throws NotFoundException
* @throws ApiException
*/
Expand Down
12 changes: 6 additions & 6 deletions tests/Builder/AlbumInfoBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function testForMbid(): void
$expected = [
'mbid' => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
];
static::assertSame($expected, $builder->getQuery());
self::assertSame($expected, $builder->getQuery());
}

public function testForAlbum(): void
Expand All @@ -34,7 +34,7 @@ public function testForAlbum(): void
'artist' => 'Slipknot',
'album' => 'IOWA',
];
static::assertSame($expected, $builder->getQuery());
self::assertSame($expected, $builder->getQuery());
}

public function testForUsername(): void
Expand All @@ -47,7 +47,7 @@ public function testForUsername(): void
'mbid' => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
'username' => 'MyUser',
];
static::assertSame($expected, $builder->getQuery());
self::assertSame($expected, $builder->getQuery());
}

public function testLanguage(): void
Expand All @@ -60,7 +60,7 @@ public function testLanguage(): void
'mbid' => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
'lang' => 'DE',
];
static::assertSame($expected, $builder->getQuery());
self::assertSame($expected, $builder->getQuery());
}

public function testAutocorrect(): void
Expand All @@ -73,7 +73,7 @@ public function testAutocorrect(): void
'mbid' => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
'autocorrect' => 1,
];
static::assertSame($expected, $builder->getQuery());
self::assertSame($expected, $builder->getQuery());
}

public function testNoAutocorrect(): void
Expand All @@ -86,6 +86,6 @@ public function testNoAutocorrect(): void
'mbid' => 'a466c2a2-6517-42fb-a160-1087c3bafd9f',
'autocorrect' => 0,
];
static::assertSame($expected, $builder->getQuery());
self::assertSame($expected, $builder->getQuery());
}
}
Loading

0 comments on commit c5cdb41

Please sign in to comment.