From dc12a8bd86e2fa42d6972179854af6f93084f884 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Nov 2025 20:22:38 +0000 Subject: [PATCH 1/3] Update phpstan/phpstan requirement from ^1.10 to ^1.10 || ^2.0 --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-version: 2.1.31 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 composer.json diff --git a/composer.json b/composer.json old mode 100755 new mode 100644 index a0cc6f0..be43281 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ }, "require-dev": { "geocoder-php/nominatim-provider": "^5.3", - "phpstan/phpstan": "^1.10" + "phpstan/phpstan": "^1.10 || ^2.0" }, "autoload": { "psr-4": { From f66429c0b9a02336dda46bc167f723e7f276634d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Sat, 8 Nov 2025 19:06:43 +0100 Subject: [PATCH 2/3] Apply PHPStan fixes --- src/BaseTestCase.php | 4 ++-- src/ProviderIntegrationTest.php | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/BaseTestCase.php b/src/BaseTestCase.php index 9e5d1e0..a74dc89 100644 --- a/src/BaseTestCase.php +++ b/src/BaseTestCase.php @@ -31,7 +31,7 @@ abstract protected function getCacheDir(); /** * Get a real HTTP client. If a cache dir is set to a path it will use cached responses. */ - protected function getHttpClient(string $apiKey = null): ClientInterface + protected function getHttpClient(?string $apiKey = null): ClientInterface { if (null !== $cacheDir = $this->getCacheDir()) { return new CachedResponseClient(new HttplugClient(), $cacheDir, $apiKey); @@ -43,7 +43,7 @@ protected function getHttpClient(string $apiKey = null): ClientInterface /** * Get a mocked HTTP client that never do calls over the internet. Use this is you want to control the response data. */ - protected function getMockedHttpClient(string $body = null, int $statusCode = 200): ClientInterface + protected function getMockedHttpClient(?string $body = null, int $statusCode = 200): ClientInterface { $client = new MockedHttpClient(); $client->addResponse(new Response($statusCode, [], $body)); diff --git a/src/ProviderIntegrationTest.php b/src/ProviderIntegrationTest.php index 94ca1c0..ef85d2a 100644 --- a/src/ProviderIntegrationTest.php +++ b/src/ProviderIntegrationTest.php @@ -213,7 +213,7 @@ public function testGeocodeIpv6(): void * @param ResponseInterface|null $response * @param string $message */ - public function testExceptions($query, string $exceptionClass, ResponseInterface $response = null, string $message = ''): void + public function testExceptions($query, string $exceptionClass, ?ResponseInterface $response = null, string $message = ''): void { if (isset($this->skippedTests[__FUNCTION__])) { $this->markTestSkipped($this->skippedTests[__FUNCTION__]); @@ -311,7 +311,6 @@ private function assertWellFormattedResult(Collection $result): void 'Location::getAdminLevels MUST always return a AdminLevelCollection' ); $arrayData = $location->toArray(); - $this->assertTrue(is_array($arrayData), 'Location::toArray MUST return an array.'); $this->assertNotEmpty($arrayData, 'Location::toArray cannot be empty.'); // Verify coordinates From 0f88c9fe61ad52f6abfb871b46bf2aa4bbef7630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Sat, 8 Nov 2025 19:07:10 +0100 Subject: [PATCH 3/3] Update php.yml --- .github/workflows/php.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index a37a7c8..f460e04 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -32,11 +32,7 @@ jobs: name: PHPStan steps: - uses: actions/checkout@v5 - - name: Use PHP 8.3 - uses: shivammathur/setup-php@v2 - with: - php-version: 8.3 - extensions: curl + - uses: shivammathur/setup-php@v2 - name: Install dependencies run: composer install --no-progress - name: Run PHPStan