Skip to content

Commit 853e954

Browse files
jbeliennorkunas
andauthored
Add PHPStan in CI (#1193)
* Add PHPStan * Update php.yml * Update composer.json * Fix PHPStan level 0 * Fix PHPStan level 1 * Update phpstan.neon * Fix PHPStan level 2 * Update composer.json * Fix PHPStan level 3 * Fix tests * Fix PHPStan level 4 * Update src/Common/Tests/TimedGeocoderTest.php Co-authored-by: Tomas Norkūnas <[email protected]> * Update src/Provider/Cache/Tests/ProviderCacheTest.php Co-authored-by: Tomas Norkūnas <[email protected]> * Update src/Provider/Cache/Tests/ProviderCacheTest.php Co-authored-by: Tomas Norkūnas <[email protected]> * Update src/Provider/GeoIP2/Tests/GeoIP2Test.php Co-authored-by: Tomas Norkūnas <[email protected]> * Fix PHPStan level 5 * Normalize composer.json * Rename analyse script * Update composer.json * Update IntegrationTest * Update AlgoliaPlacesTest * Update composer.json * Update RequestInterface vs. getParsedResponse() * Update src/Plugin/PluginProvider.php Co-authored-by: Tomas Norkūnas <[email protected]> * Update src/Plugin/PluginProvider.php Co-authored-by: Tomas Norkūnas <[email protected]> * Use PHPStan baseline instead of ignore See https://phpstan.org/user-guide/baseline --------- Co-authored-by: Tomas Norkūnas <[email protected]>
1 parent d1fa075 commit 853e954

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Tests/GeoPluginTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ public function testGeocodeWithRealIPv4()
7575

7676
$result = $results->first();
7777

78-
$this->assertEquals(40.711101999999997, $result->getCoordinates()->getLatitude(), '', 0.0001);
79-
$this->assertEquals(-73.946899000000002, $result->getCoordinates()->getLongitude(), '', 0.0001);
78+
$this->assertEqualsWithDelta(40.711101999999997, $result->getCoordinates()->getLatitude(), 0.0001);
79+
$this->assertEqualsWithDelta(-73.946899000000002, $result->getCoordinates()->getLongitude(), 0.0001);
8080
$this->assertNull($result->getLocality());
8181
$this->assertCount(1, $result->getAdminLevels());
8282
$this->assertEquals('New York', $result->getAdminLevels()->get(1)->getName());

Tests/IntegrationTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@
2121
*/
2222
class IntegrationTest extends ProviderIntegrationTest
2323
{
24-
protected $testAddress = false;
24+
protected bool $testAddress = false;
2525

26-
protected $testReverse = false;
26+
protected bool $testReverse = false;
2727

2828
protected function createProvider(ClientInterface $httpClient)
2929
{
30-
return new GeoPlugin($httpClient, $this->getApiKey());
30+
return new GeoPlugin($httpClient);
3131
}
3232

33-
protected function getCacheDir()
33+
protected function getCacheDir(): string
3434
{
3535
return __DIR__.'/.cached_responses';
3636
}
3737

38-
protected function getApiKey()
38+
protected function getApiKey(): string
3939
{
40-
return null;
40+
return '';
4141
}
4242
}

0 commit comments

Comments
 (0)