Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions src/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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));
Expand Down
3 changes: 1 addition & 2 deletions src/ProviderIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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__]);
Expand Down Expand Up @@ -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
Expand Down