Skip to content

Commit e0b8d8e

Browse files
authored
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
1 parent 2a3737e commit e0b8d8e

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Tests/TomTomTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,26 @@
2121

2222
class TomTomTest extends BaseTestCase
2323
{
24-
protected function getCacheDir()
24+
protected function getCacheDir(): string
2525
{
2626
return __DIR__.'/.cached_responses';
2727
}
2828

29-
public function testGetName()
29+
public function testGetName(): void
3030
{
3131
$provider = new TomTom($this->getMockedHttpClient(), 'api_key');
3232
$this->assertEquals('tomtom', $provider->getName());
3333
}
3434

35-
public function testGeocodeWithAddress()
35+
public function testGeocodeWithAddress(): void
3636
{
3737
$this->expectException(\Geocoder\Exception\InvalidServerResponse::class);
3838

3939
$provider = new TomTom($this->getMockedHttpClient(), 'api_key');
4040
$provider->geocodeQuery(GeocodeQuery::create('Tagensvej 47, 2200 København N'));
4141
}
4242

43-
public function testGeocodeWithRealAddress()
43+
public function testGeocodeWithRealAddress(): void
4444
{
4545
$provider = new TomTom($this->getHttpClient($_SERVER['TOMTOM_MAP_KEY']), $_SERVER['TOMTOM_MAP_KEY']);
4646
$results = $provider->geocodeQuery(GeocodeQuery::create('Tagensvej 47, 2200 København N')->withLocale('en-GB'));
@@ -64,7 +64,7 @@ public function testGeocodeWithRealAddress()
6464
$this->assertNull($result->getTimezone());
6565
}
6666

67-
public function testGeocodeWithRealAddressWithFrenchLocale()
67+
public function testGeocodeWithRealAddressWithFrenchLocale(): void
6868
{
6969
$provider = new TomTom($this->getHttpClient($_SERVER['TOMTOM_MAP_KEY']), $_SERVER['TOMTOM_MAP_KEY']);
7070
$results = $provider->geocodeQuery(GeocodeQuery::create('Tagensvej 47, 2200 København N')->withLocale('fr-FR'));
@@ -77,7 +77,7 @@ public function testGeocodeWithRealAddressWithFrenchLocale()
7777
$this->assertInstanceOf('\Geocoder\Model\Address', $result);
7878
}
7979

80-
public function testGeocodeWithLocalhostIPv4()
80+
public function testGeocodeWithLocalhostIPv4(): void
8181
{
8282
$this->expectException(\Geocoder\Exception\UnsupportedOperation::class);
8383
$this->expectExceptionMessage('The TomTom provider does not support IP addresses, only street addresses.');
@@ -86,7 +86,7 @@ public function testGeocodeWithLocalhostIPv4()
8686
$provider->geocodeQuery(GeocodeQuery::create('127.0.0.1'));
8787
}
8888

89-
public function testGeocodeWithLocalhostIPv6()
89+
public function testGeocodeWithLocalhostIPv6(): void
9090
{
9191
$this->expectException(\Geocoder\Exception\UnsupportedOperation::class);
9292
$this->expectExceptionMessage('The TomTom provider does not support IP addresses, only street addresses.');
@@ -95,7 +95,7 @@ public function testGeocodeWithLocalhostIPv6()
9595
$provider->geocodeQuery(GeocodeQuery::create('::1'));
9696
}
9797

98-
public function testGeocodeWithIPv4()
98+
public function testGeocodeWithIPv4(): void
9999
{
100100
$this->expectException(\Geocoder\Exception\UnsupportedOperation::class);
101101
$this->expectExceptionMessage('The TomTom provider does not support IP addresses, only street addresses.');
@@ -104,7 +104,7 @@ public function testGeocodeWithIPv4()
104104
$provider->geocodeQuery(GeocodeQuery::create('74.200.247.59'));
105105
}
106106

107-
public function testGeocodeWithIPv6()
107+
public function testGeocodeWithIPv6(): void
108108
{
109109
$this->expectException(\Geocoder\Exception\UnsupportedOperation::class);
110110
$this->expectExceptionMessage('The TomTom provider does not support IP addresses, only street addresses.');
@@ -113,23 +113,23 @@ public function testGeocodeWithIPv6()
113113
$provider->geocodeQuery(GeocodeQuery::create('::ffff:74.200.247.59'));
114114
}
115115

116-
public function testWithoutApiKey()
116+
public function testWithoutApiKey(): void
117117
{
118118
$this->expectException(\Geocoder\Exception\InvalidCredentials::class);
119119
$this->expectExceptionMessage('No API key provided');
120120

121121
new TomTom($this->getMockedHttpClient(), '');
122122
}
123123

124-
public function testReverse()
124+
public function testReverse(): void
125125
{
126126
$this->expectException(\Geocoder\Exception\InvalidServerResponse::class);
127127

128128
$provider = new TomTom($this->getMockedHttpClient(), 'api_key');
129129
$provider->reverseQuery(ReverseQuery::fromCoordinates(1, 2));
130130
}
131131

132-
public function testReverseError400()
132+
public function testReverseError400(): void
133133
{
134134
$error400 = <<<'JSON'
135135
{
@@ -150,7 +150,7 @@ public function testReverseError400()
150150
$this->assertEquals(0, $result->count());
151151
}
152152

153-
public function testReverseWithRealCoordinates()
153+
public function testReverseWithRealCoordinates(): void
154154
{
155155
if (!isset($_SERVER['TOMTOM_MAP_KEY'])) {
156156
$this->markTestSkipped('You need to configure the TOMTOM_MAP_KEY value in phpunit.xml');
@@ -178,7 +178,7 @@ public function testReverseWithRealCoordinates()
178178
$this->assertNull($result->getTimezone());
179179
}
180180

181-
public function testGeocodeWithRealCoordinates()
181+
public function testGeocodeWithRealCoordinates(): void
182182
{
183183
if (!isset($_SERVER['TOMTOM_MAP_KEY'])) {
184184
$this->markTestSkipped('You need to configure the TOMTOM_MAP_KEY value in phpunit.xml');

0 commit comments

Comments
 (0)