Skip to content

Commit 6797047

Browse files
Update phpstan/phpstan requirement from ^1.10 to ^1.10 || ^2.0 (#33)
* 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] <[email protected]> * Apply PHPStan fixes * Update php.yml --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jonathan Beliën <[email protected]>
1 parent 72e1bee commit 6797047

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

.github/workflows/php.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ jobs:
3232
name: PHPStan
3333
steps:
3434
- uses: actions/checkout@v5
35-
- name: Use PHP 8.3
36-
uses: shivammathur/setup-php@v2
37-
with:
38-
php-version: 8.3
39-
extensions: curl
35+
- uses: shivammathur/setup-php@v2
4036
- name: Install dependencies
4137
run: composer install --no-progress
4238
- name: Run PHPStan

composer.json

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"require-dev": {
2727
"geocoder-php/nominatim-provider": "^5.3",
28-
"phpstan/phpstan": "^1.10"
28+
"phpstan/phpstan": "^1.10 || ^2.0"
2929
},
3030
"autoload": {
3131
"psr-4": {

src/BaseTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ abstract protected function getCacheDir();
3131
/**
3232
* Get a real HTTP client. If a cache dir is set to a path it will use cached responses.
3333
*/
34-
protected function getHttpClient(string $apiKey = null): ClientInterface
34+
protected function getHttpClient(?string $apiKey = null): ClientInterface
3535
{
3636
if (null !== $cacheDir = $this->getCacheDir()) {
3737
return new CachedResponseClient(new HttplugClient(), $cacheDir, $apiKey);
@@ -43,7 +43,7 @@ protected function getHttpClient(string $apiKey = null): ClientInterface
4343
/**
4444
* Get a mocked HTTP client that never do calls over the internet. Use this is you want to control the response data.
4545
*/
46-
protected function getMockedHttpClient(string $body = null, int $statusCode = 200): ClientInterface
46+
protected function getMockedHttpClient(?string $body = null, int $statusCode = 200): ClientInterface
4747
{
4848
$client = new MockedHttpClient();
4949
$client->addResponse(new Response($statusCode, [], $body));

src/ProviderIntegrationTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public function testGeocodeIpv6(): void
213213
* @param ResponseInterface|null $response
214214
* @param string $message
215215
*/
216-
public function testExceptions($query, string $exceptionClass, ResponseInterface $response = null, string $message = ''): void
216+
public function testExceptions($query, string $exceptionClass, ?ResponseInterface $response = null, string $message = ''): void
217217
{
218218
if (isset($this->skippedTests[__FUNCTION__])) {
219219
$this->markTestSkipped($this->skippedTests[__FUNCTION__]);
@@ -311,7 +311,6 @@ private function assertWellFormattedResult(Collection $result): void
311311
'Location::getAdminLevels MUST always return a AdminLevelCollection'
312312
);
313313
$arrayData = $location->toArray();
314-
$this->assertTrue(is_array($arrayData), 'Location::toArray MUST return an array.');
315314
$this->assertNotEmpty($arrayData, 'Location::toArray cannot be empty.');
316315

317316
// Verify coordinates

0 commit comments

Comments
 (0)