From 98237506a8105ac4ab9209d7c8f7bdd05b4bf442 Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Fri, 20 Dec 2024 16:38:40 +0100 Subject: [PATCH] Upgrade to PHPStan 2 --- composer.json | 22 +++++++++++----------- src/Provider/Gitlab.php | 2 +- test/src/Provider/GitlabTest.php | 5 +++-- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 16482ec..394a6c4 100644 --- a/composer.json +++ b/composer.json @@ -24,18 +24,18 @@ "league/oauth2-client": "^2.4.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.37.1", - "guzzlehttp/psr7": "^2.6.1", + "friendsofphp/php-cs-fixer": "^3.65.0", + "guzzlehttp/psr7": "^2.7.0", "http-interop/http-factory-guzzle": "^1.2", - "infection/infection": "^0.27.7", - "m4tthumphrey/php-gitlab-api": "^11.12", - "mockery/mockery": "^1.6.6", - "php-http/guzzle7-adapter": "^1.0.0", - "phpstan/extension-installer": "^1.3.1", - "phpstan/phpstan": "^1.10.41", - "phpstan/phpstan-mockery": "^1.1.1", - "phpstan/phpstan-phpunit": "^1.3.15", - "phpunit/phpunit": "^10.4.2" + "infection/infection": "^0.27.11", + "m4tthumphrey/php-gitlab-api": "^11.14", + "mockery/mockery": "^1.6.12", + "php-http/guzzle7-adapter": "^1.1.0", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.0.4", + "phpstan/phpstan-mockery": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0.3", + "phpunit/phpunit": "^10.5.39" }, "suggest": { "m4tthumphrey/php-gitlab-api": "For further API usage using the acquired OAuth2 token" diff --git a/src/Provider/Gitlab.php b/src/Provider/Gitlab.php index 372ecbd..3a1b0be 100644 --- a/src/Provider/Gitlab.php +++ b/src/Provider/Gitlab.php @@ -90,7 +90,7 @@ protected function getScopeSeparator(): string * Check a provider response for errors. * * @param ResponseInterface $response Parsed response data - * @param array{error?: string, message?: string}|mixed $data + * @param array{error?: string, message?: string}|scalar $data * @throws IdentityProviderException */ protected function checkResponse(ResponseInterface $response, mixed $data): void diff --git a/test/src/Provider/GitlabTest.php b/test/src/Provider/GitlabTest.php index 0511844..eb6971a 100644 --- a/test/src/Provider/GitlabTest.php +++ b/test/src/Provider/GitlabTest.php @@ -66,7 +66,7 @@ public function testAuthorizationUrl(): void $this->assertArrayHasKey('scope', $query); $this->assertArrayHasKey('response_type', $query); $this->assertArrayHasKey('approval_prompt', $query); - $this->assertNotNull($this->provider->getState()); + $this->assertNotEmpty($this->provider->getState()); } public function testScopes(): void @@ -224,7 +224,8 @@ public function testDefaultValuesForResourceOwner(): void public function testApiClient(GitlabResourceOwner $owner): void { $client = $owner->getApiClient(); - $this->assertInstanceOf(\Gitlab\Client::class, $client); + + $this->assertSame(\Gitlab\Client::class, get_class($client)); } /**