Skip to content

Commit

Permalink
Fix code style issues.
Browse files Browse the repository at this point in the history
Signed-off-by: Sacha Telgenhof <[email protected]>
  • Loading branch information
stelgenhof committed Oct 10, 2023
1 parent ed26920 commit 3e2b67c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__.'/src',
__DIR__.'/tests',
__DIR__ . '/src',
__DIR__ . '/tests',
]);

// single rules
Expand Down
9 changes: 4 additions & 5 deletions src/WAQI.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ final class WAQI implements AirQuality
public function __construct(
/** World Air Quality access token. */
private string $token
) {
}
) {}

/**
* Retrieves the real-time Air Quality Index observation monitoring station name (or city name).
Expand All @@ -62,7 +61,7 @@ public function __construct(
public function getObservationByStation(string $station = null): void
{
try {
$this->request('feed/'.($station ?? 'here').'/');
$this->request('feed/' . ($station ?? 'here') . '/');
} catch (GuzzleException|\JsonException $e) {
throw new \RuntimeException($e->getMessage(), $e->getCode(), $e);
}
Expand All @@ -79,7 +78,7 @@ public function getObservationByStation(string $station = null): void
public function getObservationByGeoLocation(float $latitude, float $longitude): void
{
try {
$this->request('feed/geo:'.$latitude.';'.$longitude.'/');
$this->request('feed/geo:' . $latitude . ';' . $longitude . '/');
} catch (GuzzleException|\JsonException $e) {
throw new \RuntimeException($e->getMessage(), $e->getCode(), $e);
}
Expand Down Expand Up @@ -365,7 +364,7 @@ private function request(string $uri): void
$client = new Client(['base_uri' => self::API_ENDPOINT]);

try {
$response = $client->request('GET', $uri, ['query' => 'token='.$this->token]);
$response = $client->request('GET', $uri, ['query' => 'token=' . $this->token]);
} catch (ClientException|RequestException $e) {
echo Message::toString($e->getRequest());

Expand Down
2 changes: 1 addition & 1 deletion tests/WAQITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ public function shouldRaiseExceptionWhenInvalidTokenByGeoLocation(): void
private function assertValue(mixed $result, mixed $expectedValue, string $type): void
{
$this->assertEquals($expectedValue, $result);
$this->{'assertIs'.\ucfirst($type)}($result);
$this->{'assertIs' . \ucfirst($type)}($result);
$this->assertNotEmpty($result);
$this->assertNotNull($result);
}
Expand Down

0 comments on commit 3e2b67c

Please sign in to comment.