From e0b8d8e274fa45d514895c33d816bd28ff01a99d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Mon, 31 Jul 2023 22:07:24 +0200 Subject: [PATCH] Enable PHPStan Level 6 (#1194) * Update phpstan.neon * Update YandexTest.php * Update TomTomTest.php * Update PickPointTest.php * Update PickPoint.php * Update PhotonTest.php * Update PeliasTest.php * Update OpenRouteServiceTest.php * Update OpenCageTest.php * Update OpenCage.php * Update NominatimTest.php * Update MaxMindBinaryTest.php * Update MaxMindTest.php * [WIP] Apply PHPStan fixes * Apply PHPCSFixer fixes * [WIP] Apply PHPStan fixes * [WIP] Apply PHPStan fixes * Revert "[WIP] Apply PHPStan fixes" This reverts commit 734c5c52fbcba4bc12cbda07b58d902a79d47891. * [WIP] Apply PHPStan fixes * [WIP] Apply PHPStan fixes * Update phpstan-baseline.neon --- Tests/TomTomTest.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Tests/TomTomTest.php b/Tests/TomTomTest.php index d10d011..252cd35 100644 --- a/Tests/TomTomTest.php +++ b/Tests/TomTomTest.php @@ -21,18 +21,18 @@ class TomTomTest extends BaseTestCase { - protected function getCacheDir() + protected function getCacheDir(): string { return __DIR__.'/.cached_responses'; } - public function testGetName() + public function testGetName(): void { $provider = new TomTom($this->getMockedHttpClient(), 'api_key'); $this->assertEquals('tomtom', $provider->getName()); } - public function testGeocodeWithAddress() + public function testGeocodeWithAddress(): void { $this->expectException(\Geocoder\Exception\InvalidServerResponse::class); @@ -40,7 +40,7 @@ public function testGeocodeWithAddress() $provider->geocodeQuery(GeocodeQuery::create('Tagensvej 47, 2200 København N')); } - public function testGeocodeWithRealAddress() + public function testGeocodeWithRealAddress(): void { $provider = new TomTom($this->getHttpClient($_SERVER['TOMTOM_MAP_KEY']), $_SERVER['TOMTOM_MAP_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('Tagensvej 47, 2200 København N')->withLocale('en-GB')); @@ -64,7 +64,7 @@ public function testGeocodeWithRealAddress() $this->assertNull($result->getTimezone()); } - public function testGeocodeWithRealAddressWithFrenchLocale() + public function testGeocodeWithRealAddressWithFrenchLocale(): void { $provider = new TomTom($this->getHttpClient($_SERVER['TOMTOM_MAP_KEY']), $_SERVER['TOMTOM_MAP_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('Tagensvej 47, 2200 København N')->withLocale('fr-FR')); @@ -77,7 +77,7 @@ public function testGeocodeWithRealAddressWithFrenchLocale() $this->assertInstanceOf('\Geocoder\Model\Address', $result); } - public function testGeocodeWithLocalhostIPv4() + public function testGeocodeWithLocalhostIPv4(): void { $this->expectException(\Geocoder\Exception\UnsupportedOperation::class); $this->expectExceptionMessage('The TomTom provider does not support IP addresses, only street addresses.'); @@ -86,7 +86,7 @@ public function testGeocodeWithLocalhostIPv4() $provider->geocodeQuery(GeocodeQuery::create('127.0.0.1')); } - public function testGeocodeWithLocalhostIPv6() + public function testGeocodeWithLocalhostIPv6(): void { $this->expectException(\Geocoder\Exception\UnsupportedOperation::class); $this->expectExceptionMessage('The TomTom provider does not support IP addresses, only street addresses.'); @@ -95,7 +95,7 @@ public function testGeocodeWithLocalhostIPv6() $provider->geocodeQuery(GeocodeQuery::create('::1')); } - public function testGeocodeWithIPv4() + public function testGeocodeWithIPv4(): void { $this->expectException(\Geocoder\Exception\UnsupportedOperation::class); $this->expectExceptionMessage('The TomTom provider does not support IP addresses, only street addresses.'); @@ -104,7 +104,7 @@ public function testGeocodeWithIPv4() $provider->geocodeQuery(GeocodeQuery::create('74.200.247.59')); } - public function testGeocodeWithIPv6() + public function testGeocodeWithIPv6(): void { $this->expectException(\Geocoder\Exception\UnsupportedOperation::class); $this->expectExceptionMessage('The TomTom provider does not support IP addresses, only street addresses.'); @@ -113,7 +113,7 @@ public function testGeocodeWithIPv6() $provider->geocodeQuery(GeocodeQuery::create('::ffff:74.200.247.59')); } - public function testWithoutApiKey() + public function testWithoutApiKey(): void { $this->expectException(\Geocoder\Exception\InvalidCredentials::class); $this->expectExceptionMessage('No API key provided'); @@ -121,7 +121,7 @@ public function testWithoutApiKey() new TomTom($this->getMockedHttpClient(), ''); } - public function testReverse() + public function testReverse(): void { $this->expectException(\Geocoder\Exception\InvalidServerResponse::class); @@ -129,7 +129,7 @@ public function testReverse() $provider->reverseQuery(ReverseQuery::fromCoordinates(1, 2)); } - public function testReverseError400() + public function testReverseError400(): void { $error400 = <<<'JSON' { @@ -150,7 +150,7 @@ public function testReverseError400() $this->assertEquals(0, $result->count()); } - public function testReverseWithRealCoordinates() + public function testReverseWithRealCoordinates(): void { if (!isset($_SERVER['TOMTOM_MAP_KEY'])) { $this->markTestSkipped('You need to configure the TOMTOM_MAP_KEY value in phpunit.xml'); @@ -178,7 +178,7 @@ public function testReverseWithRealCoordinates() $this->assertNull($result->getTimezone()); } - public function testGeocodeWithRealCoordinates() + public function testGeocodeWithRealCoordinates(): void { if (!isset($_SERVER['TOMTOM_MAP_KEY'])) { $this->markTestSkipped('You need to configure the TOMTOM_MAP_KEY value in phpunit.xml');