From 04d543be5b67f939e2885d24966f521594febe50 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 17 Mar 2024 21:29:48 +0000 Subject: [PATCH] Fixes --- phpstan-baseline.neon | 10 ++++++++++ psalm-baseline.xml | 12 +++++++++++- psalm.xml | 2 ++ src/Api/Repositories.php | 28 +++++++++++++++------------- vendor-bin/phpstan/composer.json | 4 ++-- vendor-bin/phpunit/composer.json | 2 +- vendor-bin/psalm/composer.json | 2 +- 7 files changed, 42 insertions(+), 18 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 34beb6de..cfeceeaf 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -20,6 +20,16 @@ parameters: count: 1 path: src/Api/AbstractApi.php + - + message: "#^PHPDoc tag @return contains generic type Http\\\\Promise\\\\Promise\\ but interface Http\\\\Promise\\\\Promise is not generic\\.$#" + count: 1 + path: src/HttpClient/Plugin/Authentication.php + + - + message: "#^PHPDoc tag @return contains generic type Http\\\\Promise\\\\Promise\\ but interface Http\\\\Promise\\\\Promise is not generic\\.$#" + count: 1 + path: src/HttpClient/Plugin/ExceptionThrower.php + - message: "#^Cannot cast mixed to string\\.$#" count: 1 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index ec73699b..88bf06d2 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + + + + ]]> + + + + + ]]> + + perPage]]> diff --git a/psalm.xml b/psalm.xml index 6b3b81a1..3dd74b68 100644 --- a/psalm.xml +++ b/psalm.xml @@ -6,6 +6,8 @@ xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" errorBaseline="psalm-baseline.xml" + findUnusedBaselineEntry="true" + findUnusedCode="false" > diff --git a/src/Api/Repositories.php b/src/Api/Repositories.php index 809f556e..02305867 100644 --- a/src/Api/Repositories.php +++ b/src/Api/Repositories.php @@ -144,37 +144,39 @@ public function createTag($project_id, string $name, string $ref, ?string $messa } /** - * @param int|string $project_id - * @param string $tag_name - * @param string $description - * @param ?string $name + * @param int|string $project_id + * @param string $tag_name + * @param string $description + * @param string|null $name * * @return mixed */ public function createRelease($project_id, string $tag_name, string $description, ?string $name = null) { - return $this->post($this->getProjectPath($project_id, 'releases'), [ + return $this->post($this->getProjectPath($project_id, 'releases'), array_filter([ 'id' => $project_id, 'tag_name' => $tag_name, 'description' => $description, - 'name' => $name ?? $tag_name, - ]); + 'name' => $name, + ], fn ($v) => null !== $v)); } /** - * @param int|string $project_id - * @param string $tag_name - * @param string $description + * @param int|string $project_id + * @param string $tag_name + * @param string $description + * @param string|null $name * * @return mixed */ - public function updateRelease($project_id, string $tag_name, string $description) + public function updateRelease($project_id, string $tag_name, string $description, ?string $name = null) { - return $this->put($this->getProjectPath($project_id, 'releases/'.self::encodePath($tag_name)), [ + return $this->put($this->getProjectPath($project_id, 'releases/'.self::encodePath($tag_name)), array_filter([ 'id' => $project_id, 'tag_name' => $tag_name, 'description' => $description, - ]); + 'name' => $name, + ], fn ($v) => null !== $v)); } /** diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json index 38f61a08..95323c40 100644 --- a/vendor-bin/phpstan/composer.json +++ b/vendor-bin/phpstan/composer.json @@ -1,11 +1,11 @@ { "require": { "php": "^8.1", - "phpstan/phpstan": "1.10.47", + "phpstan/phpstan": "1.10.62", "phpstan/phpstan-deprecation-rules": "1.1.4", "phpstan/phpstan-strict-rules": "1.5.2", "thecodingmachine/phpstan-strict-rules": "1.0.0", - "ergebnis/phpstan-rules": "2.1.0" + "ergebnis/phpstan-rules": "2.2.0" }, "config": { "preferred-install": "dist" diff --git a/vendor-bin/phpunit/composer.json b/vendor-bin/phpunit/composer.json index ce2646eb..73f48cf4 100644 --- a/vendor-bin/phpunit/composer.json +++ b/vendor-bin/phpunit/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^7.4.15 || ^8.0.2", - "phpunit/phpunit": "^9.6.15 || ^10.5.1" + "phpunit/phpunit": "^9.6.17 || ^10.5.13" }, "config": { "preferred-install": "dist" diff --git a/vendor-bin/psalm/composer.json b/vendor-bin/psalm/composer.json index 5a8af7c0..d0f9668b 100644 --- a/vendor-bin/psalm/composer.json +++ b/vendor-bin/psalm/composer.json @@ -1,7 +1,7 @@ { "require": { "php": "^8.1", - "psalm/phar": "5.16.0" + "psalm/phar": "5.23.1" }, "config": { "preferred-install": "dist"