Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Mar 17, 2024
1 parent 26a4f3a commit 04d543b
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 18 deletions.
10 changes: 10 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ parameters:
count: 1
path: src/Api/AbstractApi.php

-
message: "#^PHPDoc tag @return contains generic type Http\\\\Promise\\\\Promise\\<Psr\\\\Http\\\\Message\\\\ResponseInterface\\> 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\\<Psr\\\\Http\\\\Message\\\\ResponseInterface\\> but interface Http\\\\Promise\\\\Promise is not generic\\.$#"
count: 1
path: src/HttpClient/Plugin/ExceptionThrower.php

-
message: "#^Cannot cast mixed to string\\.$#"
count: 1
Expand Down
12 changes: 11 additions & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.16.0@2897ba636551a8cb61601cc26f6ccfbba6c36591">
<files psalm-version="5.23.1@8471a896ccea3526b26d082f4461eeea467f10a4">
<file src="src/Api/AbstractApi.php">
<InvalidArgument>
<code><![CDATA[function () use ($filename, $mode, &$ex): void {
Expand All @@ -17,6 +17,16 @@
<code><![CDATA['is_int']]></code>
</TypeDoesNotContainType>
</file>
<file src="src/HttpClient/Plugin/Authentication.php">
<TooManyTemplateParams>
<code><![CDATA[Promise<ResponseInterface>]]></code>
</TooManyTemplateParams>
</file>
<file src="src/HttpClient/Plugin/ExceptionThrower.php">
<TooManyTemplateParams>
<code><![CDATA[Promise<ResponseInterface>]]></code>
</TooManyTemplateParams>
</file>
<file src="src/ResultPager.php">
<InaccessibleProperty>
<code><![CDATA[$clone->perPage]]></code>
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
<issueHandlers>
<PossiblyInvalidDocblockTag errorLevel="info" />
Expand Down
28 changes: 15 additions & 13 deletions src/Api/Repositories.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions vendor-bin/phpstan/composer.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/phpunit/composer.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/psalm/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"require": {
"php": "^8.1",
"psalm/phar": "5.16.0"
"psalm/phar": "5.23.1"
},
"config": {
"preferred-install": "dist"
Expand Down

0 comments on commit 04d543b

Please sign in to comment.