Skip to content

Commit

Permalink
style: Upgrade to use latest PHP CS Fixer config and fix code style i…
Browse files Browse the repository at this point in the history
…ssues

Signed-off-by: Sacha Telgenhof <[email protected]>
  • Loading branch information
stelgenhof committed Jan 30, 2024
1 parent 4713ada commit e4a4a83
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"guzzlehttp/guzzle": "^7.8"
},
"require-dev": {
"azuyalabs/php-cs-fixer-config": "dev-dev",
"azuyalabs/php-cs-fixer-config": "^0.1",
"fakerphp/faker": "^1.23",
"friendsofphp/php-cs-fixer": "^v3.15",
"infection/infection": "^0.26",
Expand Down
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types=1);
declare(strict_types = 1);

/**
* This file is part of the 'azuyalabs/waqi' package.
Expand Down
2 changes: 1 addition & 1 deletion src/AirQuality.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types=1);
declare(strict_types = 1);

/**
* This file is part of the 'azuyalabs/waqi' package.
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/InvalidAccessToken.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types=1);
declare(strict_types = 1);

/**
* This file is part of the 'azuyalabs/waqi' package.
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/QuotaExceeded.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types=1);
declare(strict_types = 1);

/**
* This file is part of the 'azuyalabs/waqi' package.
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/UnknownStation.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types=1);
declare(strict_types = 1);

/**
* This file is part of the 'azuyalabs/waqi' package.
Expand Down
2 changes: 1 addition & 1 deletion src/WAQI.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types=1);
declare(strict_types = 1);

/**
* This file is part of the 'azuyalabs/waqi' package.
Expand Down
50 changes: 25 additions & 25 deletions tests/WAQITest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types=1);
declare(strict_types = 1);

/**
* This file is part of the 'azuyalabs/waqi' package.
Expand Down Expand Up @@ -55,7 +55,7 @@ protected function tearDown(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getTemperature()
*/
public function shouldGetTemperature(): void
public function should_get_temperature(): void
{
$this->assertPollutantLevel('getTemperature', $this->faker->randomFloat(2, -100, 100));
}
Expand All @@ -67,7 +67,7 @@ public function shouldGetTemperature(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getPressure()
*/
public function shouldGetPressure(): void
public function should_get_pressure(): void
{
$this->assertPollutantLevel('getPressure', $this->faker->randomFloat(2, -800, 1100));
}
Expand All @@ -79,7 +79,7 @@ public function shouldGetPressure(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getHumidity()
*/
public function shouldGetHumidity(): void
public function should_get_humidity(): void
{
$this->assertPollutantLevel('getHumidity', $this->faker->randomFloat(2, -800, 1100));
}
Expand All @@ -91,7 +91,7 @@ public function shouldGetHumidity(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getPM25()
*/
public function shouldGetPM25(): void
public function should_get_p_m25(): void
{
$this->assertPollutantLevel('getPM25', $this->faker->randomFloat(2, 0, 500));
}
Expand All @@ -104,7 +104,7 @@ public function shouldGetPM25(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getPM25()
*/
public function shouldGetNullIfNoPM25(): void
public function should_get_null_if_no_p_m25(): void
{
$this->assertNoPollutantReading('getPM25');
}
Expand All @@ -116,7 +116,7 @@ public function shouldGetNullIfNoPM25(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getPM10()
*/
public function shouldGetPM10(): void
public function should_get_p_m10(): void
{
$this->assertPollutantLevel('getPM10', $this->faker->randomFloat(2, 0, 500));
}
Expand All @@ -129,7 +129,7 @@ public function shouldGetPM10(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getPM10()
*/
public function shouldGetNullIfNoPM10(): void
public function should_get_null_if_no_p_m10(): void
{
$this->assertNoPollutantReading('getPM10');
}
Expand All @@ -141,7 +141,7 @@ public function shouldGetNullIfNoPM10(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getCO()
*/
public function shouldGetCO(): void
public function should_get_co(): void
{
$this->assertPollutantLevel('getCO', $this->faker->randomFloat(2, 0, 500));
}
Expand All @@ -154,7 +154,7 @@ public function shouldGetCO(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getCO()
*/
public function shouldGetNullIfNoCO(): void
public function should_get_null_if_no_co(): void
{
$this->assertNoPollutantReading('getCO');
}
Expand All @@ -166,7 +166,7 @@ public function shouldGetNullIfNoCO(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getNO2()
*/
public function shouldGetNO2(): void
public function should_get_n_o2(): void
{
$this->assertPollutantLevel('getNO2', $this->faker->randomFloat(2, 0, 500));
}
Expand All @@ -179,7 +179,7 @@ public function shouldGetNO2(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getNO2()
*/
public function shouldGetNullIfNoNO2(): void
public function should_get_null_if_no_n_o2(): void
{
$this->assertNoPollutantReading('getNO2');
}
Expand All @@ -191,7 +191,7 @@ public function shouldGetNullIfNoNO2(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getO3()
*/
public function shouldGetO3(): void
public function should_get_o3(): void
{
$this->assertPollutantLevel('getO3', $this->faker->randomFloat(2, 0, 500));
}
Expand All @@ -204,7 +204,7 @@ public function shouldGetO3(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getO3()
*/
public function shouldGetNullIfNoO3(): void
public function should_get_null_if_no_o3(): void
{
$this->assertNoPollutantReading('getO3');
}
Expand All @@ -216,7 +216,7 @@ public function shouldGetNullIfNoO3(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getSO2()
*/
public function shouldGetSO2(): void
public function should_get_s_o2(): void
{
$this->assertPollutantLevel('getSO2', $this->faker->randomFloat(2, 0, 500));
}
Expand All @@ -229,7 +229,7 @@ public function shouldGetSO2(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getSO2()
*/
public function shouldGetNullIfNoSO2(): void
public function should_get_null_if_no_s_o2(): void
{
$this->assertNoPollutantReading('getSO2');
}
Expand All @@ -243,7 +243,7 @@ public function shouldGetNullIfNoSO2(): void
*
* @throws \Exception
*/
public function shouldGetMeasurementTime(): void
public function should_get_measurement_time(): void
{
$expectedValue = $this->faker->dateTime();

Expand All @@ -266,7 +266,7 @@ public function shouldGetMeasurementTime(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getMonitoringStation()
*/
public function shouldGetMonitoringStationInformation(): void
public function should_get_monitoring_station_information(): void
{
$expectedValue = [
'id' => $this->faker->randomDigitNotNull(),
Expand Down Expand Up @@ -302,7 +302,7 @@ public function shouldGetMonitoringStationInformation(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getAQI()
*/
public function shouldGetAQIInformation(): void
public function should_get_aqi_information(): void
{
$expectedValue = [
'aqi' => $this->faker->randomFloat(2, 0, 500),
Expand Down Expand Up @@ -332,7 +332,7 @@ public function shouldGetAQIInformation(): void
*
* @covers \Azuyalabs\WAQI\WAQI::getPrimaryPollutant()
*/
public function shouldGetPrimaryPollutant(): void
public function should_get_primary_pollutant(): void
{
$expectedValue = $this->faker->randomElement(['pm25', 'pm10', 'co', 'no2', 'o3', 'so2']);

Expand All @@ -352,7 +352,7 @@ public function shouldGetPrimaryPollutant(): void
*
* @test
*/
public function shouldRaiseExceptionWhenUnknownStationNameByStation(): void
public function should_raise_exception_when_unknown_station_name_by_station(): void
{
$this->expectException(UnknownStation::class);
$station = 'xxxx';
Expand All @@ -374,7 +374,7 @@ public function shouldRaiseExceptionWhenUnknownStationNameByStation(): void
*
* @test
*/
public function shouldRaiseExceptionWhenQuotaExceededByStation(): void
public function should_raise_exception_when_quota_exceeded_by_station(): void
{
$this->expectException(QuotaExceeded::class);
$station = $this->faker->city();
Expand All @@ -396,7 +396,7 @@ public function shouldRaiseExceptionWhenQuotaExceededByStation(): void
*
* @test
*/
public function shouldRaiseExceptionWhenInvalidTokenByStation(): void
public function should_raise_exception_when_invalid_token_by_station(): void
{
$this->expectException(InvalidAccessToken::class);
$station = $this->faker->city();
Expand All @@ -420,7 +420,7 @@ public function shouldRaiseExceptionWhenInvalidTokenByStation(): void
*
* @throws InvalidAccessToken|UnknownStation
*/
public function shouldRaiseExceptionWhenQuotaExceededByGeoLocation(): void
public function should_raise_exception_when_quota_exceeded_by_geo_location(): void
{
$this->expectException(QuotaExceeded::class);

Expand All @@ -443,7 +443,7 @@ public function shouldRaiseExceptionWhenQuotaExceededByGeoLocation(): void
*
* @throws QuotaExceeded|UnknownStation
*/
public function shouldRaiseExceptionWhenInvalidTokenByGeoLocation(): void
public function should_raise_exception_when_invalid_token_by_geo_location(): void
{
$this->expectException(InvalidAccessToken::class);

Expand Down

0 comments on commit e4a4a83

Please sign in to comment.