Skip to content

Commit 600cf9f

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 a13a2c9 commit 600cf9f

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

MapTiler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ private function featureToAddress(\stdClass $feature): Location
121121
return $builder->build();
122122
}
123123

124+
/**
125+
* @param array<string, \stdClass> $context
126+
*/
124127
private function extractFromContext(AddressBuilder &$builder, array $context): AddressBuilder
125128
{
126129
$cityContext = array_filter($context, function ($c) { return 1 === preg_match('/^city\.\d+$/', $c->id); });

Tests/MapTilerTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
*/
2424
class MapTilerTest extends BaseTestCase
2525
{
26-
protected function getCacheDir()
26+
protected function getCacheDir(): string
2727
{
2828
return __DIR__.'/.cached_responses';
2929
}
3030

31-
public function testGeocodeWithLocalhostIPv4()
31+
public function testGeocodeWithLocalhostIPv4(): void
3232
{
3333
if (!isset($_SERVER['MAPTILER_KEY'])) {
3434
$this->markTestSkipped('You need to configure the MAPTILER_KEY value in phpunit.xml');
@@ -41,7 +41,7 @@ public function testGeocodeWithLocalhostIPv4()
4141
$provider->geocodeQuery(GeocodeQuery::create('127.0.0.1'));
4242
}
4343

44-
public function testGeocodeWithLocalhostIPv6()
44+
public function testGeocodeWithLocalhostIPv6(): void
4545
{
4646
if (!isset($_SERVER['MAPTILER_KEY'])) {
4747
$this->markTestSkipped('You need to configure the MAPTILER_KEY value in phpunit.xml');
@@ -54,7 +54,7 @@ public function testGeocodeWithLocalhostIPv6()
5454
$provider->geocodeQuery(GeocodeQuery::create('::1'));
5555
}
5656

57-
public function testGeocodeWithRealIPv6()
57+
public function testGeocodeWithRealIPv6(): void
5858
{
5959
if (!isset($_SERVER['MAPTILER_KEY'])) {
6060
$this->markTestSkipped('You need to configure the MAPTILER_KEY value in phpunit.xml');
@@ -67,7 +67,7 @@ public function testGeocodeWithRealIPv6()
6767
$provider->geocodeQuery(GeocodeQuery::create('::ffff:88.188.221.14'));
6868
}
6969

70-
public function testGeocodeQueryStreet()
70+
public function testGeocodeQueryStreet(): void
7171
{
7272
if (!isset($_SERVER['MAPTILER_KEY'])) {
7373
$this->markTestSkipped('You need to configure the MAPTILER_KEY value in phpunit.xml');
@@ -92,7 +92,7 @@ public function testGeocodeQueryStreet()
9292
$this->assertEquals('France', $result->getCountry());
9393
}
9494

95-
public function testGeocodeQueryCity()
95+
public function testGeocodeQueryCity(): void
9696
{
9797
if (!isset($_SERVER['MAPTILER_KEY'])) {
9898
$this->markTestSkipped('You need to configure the MAPTILER_KEY value in phpunit.xml');
@@ -115,7 +115,7 @@ public function testGeocodeQueryCity()
115115
$this->assertEquals('France', $result->getCountry());
116116
}
117117

118-
public function testReverseQuery()
118+
public function testReverseQuery(): void
119119
{
120120
if (!isset($_SERVER['MAPTILER_KEY'])) {
121121
$this->markTestSkipped('You need to configure the MAPTILER_KEY value in phpunit.xml');

0 commit comments

Comments
 (0)