Skip to content

Commit 9269633

Browse files
Fixes
1 parent f44ed77 commit 9269633

File tree

7 files changed

+84
-28
lines changed

7 files changed

+84
-28
lines changed

phpstan-baseline.neon

+70-8
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,104 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Parameter \\#1 \\$callback of function set_error_handler expects \\(callable\\(int, string, string, int\\)\\: bool\\)\\|null, Closure\\(\\)\\: void given\\.$#"
4+
message: '#^Parameter \#1 \$callback of function set_error_handler expects \(callable\(int, string, string, int\)\: bool\)\|null, Closure\(\)\: void given\.$#'
5+
identifier: argument.type
56
count: 1
67
path: src/Api/AbstractApi.php
78

89
-
9-
message: "#^Parameter \\#2 \\$resource of method Http\\\\Message\\\\MultipartStream\\\\MultipartStreamBuilder\\:\\:addResource\\(\\) expects Psr\\\\Http\\\\Message\\\\StreamInterface\\|resource\\|string, mixed given\\.$#"
10+
message: '#^Parameter \#2 \$resource of method Http\\Message\\MultipartStream\\MultipartStreamBuilder\:\:addResource\(\) expects Psr\\Http\\Message\\StreamInterface\|resource\|string, mixed given\.$#'
11+
identifier: argument.type
1012
count: 1
1113
path: src/Api/AbstractApi.php
1214

1315
-
14-
message: "#^Parameter \\#4 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#"
16+
message: '#^Parameter \#4 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#'
17+
identifier: argument.type
1518
count: 1
1619
path: src/Api/AbstractApi.php
1720

1821
-
19-
message: "#^Property Gitlab\\\\Api\\\\AbstractApi\\:\\:\\$perPage is never written, only read\\.$#"
22+
message: '#^Property Gitlab\\Api\\AbstractApi\:\:\$perPage \(int\|null\) is never assigned int so it can be removed from the property type\.$#'
23+
identifier: property.unusedType
2024
count: 1
2125
path: src/Api/AbstractApi.php
2226

2327
-
24-
message: "#^PHPDoc tag @return contains generic type Http\\\\Promise\\\\Promise\\<Psr\\\\Http\\\\Message\\\\ResponseInterface\\> but interface Http\\\\Promise\\\\Promise is not generic\\.$#"
28+
message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#'
29+
identifier: foreach.nonIterable
30+
count: 1
31+
path: src/Api/Groups.php
32+
33+
-
34+
message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#'
35+
identifier: foreach.nonIterable
36+
count: 2
37+
path: src/Api/Projects.php
38+
39+
-
40+
message: '#^Parameter \#1 \$array of function array_values expects array\<T\>, mixed given\.$#'
41+
identifier: argument.type
42+
count: 1
43+
path: src/Api/Projects.php
44+
45+
-
46+
message: '#^Parameter \#1 \$options of method Symfony\\Component\\OptionsResolver\\OptionsResolver\:\:resolve\(\) expects array, mixed given\.$#'
47+
identifier: argument.type
48+
count: 1
49+
path: src/Api/Repositories.php
50+
51+
-
52+
message: '#^Parameter \#1 \$uri of static method Gitlab\\Api\\AbstractApi\:\:encodePath\(\) expects int\|string, mixed given\.$#'
53+
identifier: argument.type
54+
count: 3
55+
path: src/Api/RepositoryFiles.php
56+
57+
-
58+
message: '#^Parameter \#1 \$message of static method Gitlab\\HttpClient\\Message\\ResponseMediator\:\:getMessageAsString\(\) expects array, mixed given\.$#'
59+
identifier: argument.type
60+
count: 1
61+
path: src/HttpClient/Message/ResponseMediator.php
62+
63+
-
64+
message: '#^Parameter \#3 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#'
65+
identifier: argument.type
66+
count: 2
67+
path: src/HttpClient/Message/ResponseMediator.php
68+
69+
-
70+
message: '#^PHPDoc tag @return contains generic type Http\\Promise\\Promise\<Psr\\Http\\Message\\ResponseInterface\> but interface Http\\Promise\\Promise is not generic\.$#'
71+
identifier: generics.notGeneric
2572
count: 1
2673
path: src/HttpClient/Plugin/Authentication.php
2774

2875
-
29-
message: "#^PHPDoc tag @return contains generic type Http\\\\Promise\\\\Promise\\<Psr\\\\Http\\\\Message\\\\ResponseInterface\\> but interface Http\\\\Promise\\\\Promise is not generic\\.$#"
76+
message: '#^PHPDoc tag @return contains generic type Http\\Promise\\Promise\<Psr\\Http\\Message\\ResponseInterface\> but interface Http\\Promise\\Promise is not generic\.$#'
77+
identifier: generics.notGeneric
3078
count: 1
3179
path: src/HttpClient/Plugin/ExceptionThrower.php
3280

3381
-
34-
message: "#^Cannot cast mixed to string\\.$#"
82+
message: '#^PHPDoc tag @var with type string is not subtype of native type non\-empty\-string\|false\.$#'
83+
identifier: varTag.nativeType
84+
count: 1
85+
path: src/HttpClient/Util/JsonArray.php
86+
87+
-
88+
message: '#^Cannot cast mixed to string\.$#'
89+
identifier: cast.string
3590
count: 1
3691
path: src/HttpClient/Util/QueryStringBuilder.php
3792

3893
-
39-
message: "#^Variable method call on Gitlab\\\\Api\\\\AbstractApi\\.$#"
94+
message: '#^PHPDoc tag @var with type Closure\(Gitlab\\Api\\AbstractApi\)\: Gitlab\\Api\\AbstractApi is not subtype of type Closure\(Gitlab\\Api\\AbstractApi\)\: Gitlab\\Api\\AbstractApi\.$#'
95+
identifier: varTag.type
96+
count: 1
97+
path: src/ResultPager.php
98+
99+
-
100+
message: '#^Variable method call on Gitlab\\Api\\AbstractApi\.$#'
101+
identifier: method.dynamicName
40102
count: 1
41103
path: src/ResultPager.php
42104

phpstan.neon.dist

+4-9
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,15 @@ includes:
22
- phpstan-baseline.neon
33
- vendor-bin/phpstan/vendor/phpstan/phpstan-deprecation-rules/rules.neon
44
- vendor-bin/phpstan/vendor/phpstan/phpstan-strict-rules/rules.neon
5-
- vendor-bin/phpstan/vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
6-
7-
rules:
8-
- Ergebnis\PHPStan\Rules\Closures\NoNullableReturnTypeDeclarationRule
9-
- Ergebnis\PHPStan\Rules\Expressions\NoCompactRule
10-
- Ergebnis\PHPStan\Rules\Expressions\NoEvalRule
11-
- Ergebnis\PHPStan\Rules\Files\DeclareStrictTypesRule
12-
- Ergebnis\PHPStan\Rules\Methods\PrivateInFinalClassRule
135

146
parameters:
157
level: max
16-
checkMissingIterableValueType: false
178
paths:
189
- src
1910
ignoreErrors:
2011
- '#Only booleans are allowed in an if condition#'
2112
- '#PHPDoc tag \@var above a method has no effect.#'
13+
- '#return type has no value type specified in iterable type array#'
14+
- '#no value type specified in iterable type array#'
15+
- '#expects array\<string, mixed\>, array given#'
16+
- '#expects array\<string, string\>, array given#'

psalm-baseline.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.23.1@8471a896ccea3526b26d082f4461eeea467f10a4">
2+
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
33
<file src="src/Api/AbstractApi.php">
44
<InvalidArgument>
55
<code><![CDATA[function () use ($filename, $mode, &$ex): void {

tests/Api/TagsTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,15 @@ public static function releaseDataProvider(): array
138138
{
139139
return [
140140
[
141-
'tagName' => 'v1.1.0',
141+
'releaseName' => 'v1.1.0',
142142
'description' => 'Amazing release. Wow',
143143
'expectedResult' => [
144144
'tag_name' => '1.0.0',
145145
'description' => 'Amazing release. Wow',
146146
],
147147
],
148148
[
149-
'tagName' => 'version/1.1.0',
149+
'releaseName' => 'version/1.1.0',
150150
'description' => 'Amazing release. Wow',
151151
'expectedResult' => [
152152
'tag_name' => 'version/1.1.0',

vendor-bin/phpstan/composer.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"require": {
33
"php": "^8.1",
4-
"phpstan/phpstan": "1.10.62",
5-
"phpstan/phpstan-deprecation-rules": "1.1.4",
6-
"phpstan/phpstan-strict-rules": "1.5.2",
7-
"thecodingmachine/phpstan-strict-rules": "1.0.0",
8-
"ergebnis/phpstan-rules": "2.2.0"
4+
"phpstan/phpstan": "2.1.6",
5+
"phpstan/phpstan-deprecation-rules": "2.0.1",
6+
"phpstan/phpstan-strict-rules": "2.0.3",
7+
"ergebnis/phpstan-rules": "2.8.0"
98
},
109
"config": {
1110
"preferred-install": "dist"

vendor-bin/phpunit/composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
3-
"php": "^7.4.15 || ^8.0.2",
4-
"phpunit/phpunit": "^9.6.17 || ^10.5.13"
3+
"php": "^8.1",
4+
"phpunit/phpunit": "^10.5.45"
55
},
66
"config": {
77
"preferred-install": "dist"

vendor-bin/psalm/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
33
"php": "^8.1",
4-
"psalm/phar": "5.23.1"
4+
"psalm/phar": "5.26.1"
55
},
66
"config": {
77
"preferred-install": "dist"

0 commit comments

Comments
 (0)