From 8a93527102d635dbc93241c7c509cea4bdb70591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Nork=C5=ABnas?= Date: Sat, 7 Jun 2025 11:08:41 +0300 Subject: [PATCH] Resolve some deprecations and remove igorw/get-in dependency (#1257) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove `igorw/get-in` dependency to simplify code * Fix phpunit deprecation * Simplify phpunit's `->will($this->returnValue())` with `->willReturn()` * Simplify phpunit's `->will($this->returnCallback())` with `->willReturnCallback()` * Fix deprecated mock builder `setMethds` with `createPartialMock` * Remove deprecated phpstan `checkGenericClassInNonGenericObjectType` option * Bump phpunit to 9.6 --------- Co-authored-by: Jonathan Beliƫn --- Tests/ProviderCacheTest.php | 9 ++------- composer.json | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Tests/ProviderCacheTest.php b/Tests/ProviderCacheTest.php index 47b95b0..df179a0 100644 --- a/Tests/ProviderCacheTest.php +++ b/Tests/ProviderCacheTest.php @@ -41,14 +41,9 @@ protected function setUp(): void { parent::setUp(); - $this->cacheMock = $this->getMockBuilder(CacheInterface::class) - ->setMethods(['get', 'set', 'delete', 'clear', 'setMultiple', 'getMultiple', 'deleteMultiple', 'has']) + $this->cacheMock = $this->createPartialMock(CacheInterface::class, ['get', 'set', 'delete', 'clear', 'setMultiple', 'getMultiple', 'deleteMultiple', 'has']); - ->getMock(); - - $this->providerMock = $this->getMockBuilder(Provider::class) - ->setMethods(['getFoo', 'getName', 'geocodeQuery', 'reverseQuery']) - ->getMock(); + $this->providerMock = $this->createPartialMock(Provider::class, ['getName', 'geocodeQuery', 'reverseQuery']); } public function testName(): void diff --git a/composer.json b/composer.json index 8d025a0..ad1331a 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "geocoder-php/provider-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.6.11" }, "extra": { "branch-alias": {