Skip to content

Commit 7b1eb72

Browse files
committed
Add PHPStan configuration with baseline
1 parent 7a4c63e commit 7b1eb72

2 files changed

Lines changed: 208 additions & 1 deletion

File tree

phpstan-baseline.neon

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Binary operation "\+" between int\<1, max\> and mixed results in an error\.$#'
5+
identifier: binaryOp.invalid
6+
count: 1
7+
path: src/Google/RestApi.php
8+
9+
-
10+
message: '#^Binary operation "\." between ''Bearer '' and mixed results in an error\.$#'
11+
identifier: binaryOp.invalid
12+
count: 1
13+
path: src/Google/RestApi.php
14+
15+
-
16+
message: '#^Call to an undefined method GuzzleHttp\\Client\:\:options\(\)\.$#'
17+
identifier: method.notFound
18+
count: 1
19+
path: src/Google/RestApi.php
20+
21+
-
22+
message: '#^Cannot access offset ''access_token'' on mixed\.$#'
23+
identifier: offsetAccess.nonOffsetAccessible
24+
count: 1
25+
path: src/Google/RestApi.php
26+
27+
-
28+
message: '#^Cannot access offset ''expires_in'' on mixed\.$#'
29+
identifier: offsetAccess.nonOffsetAccessible
30+
count: 1
31+
path: src/Google/RestApi.php
32+
33+
-
34+
message: '#^Cannot call method fetchAuthToken\(\) on mixed\.$#'
35+
identifier: method.nonObject
36+
count: 1
37+
path: src/Google/RestApi.php
38+
39+
-
40+
message: '#^Method Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:authorize\(\) return type has no value type specified in iterable type array\.$#'
41+
identifier: missingType.iterableValue
42+
count: 1
43+
path: src/Google/RestApi.php
44+
45+
-
46+
message: '#^Method Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:createWithServiceAccount\(\) has parameter \$scopes with no value type specified in iterable type array\.$#'
47+
identifier: missingType.iterableValue
48+
count: 1
49+
path: src/Google/RestApi.php
50+
51+
-
52+
message: '#^Method Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:createWithServiceAccount\(\) has parameter \$serviceAccountConfig with no value type specified in iterable type array\.$#'
53+
identifier: missingType.iterableValue
54+
count: 1
55+
path: src/Google/RestApi.php
56+
57+
-
58+
message: '#^Method Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:decideRetry\(\) should return bool but returns mixed\.$#'
59+
identifier: return.type
60+
count: 1
61+
path: src/Google/RestApi.php
62+
63+
-
64+
message: '#^Method Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:getRefreshToken\(\) return type has no value type specified in iterable type array\.$#'
65+
identifier: missingType.iterableValue
66+
count: 1
67+
path: src/Google/RestApi.php
68+
69+
-
70+
message: '#^Method Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:getServiceAccountAccessToken\(\) should return string but returns mixed\.$#'
71+
identifier: return.type
72+
count: 1
73+
path: src/Google/RestApi.php
74+
75+
-
76+
message: '#^Method Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:refreshToken\(\) return type has no value type specified in iterable type array\.$#'
77+
identifier: missingType.iterableValue
78+
count: 1
79+
path: src/Google/RestApi.php
80+
81+
-
82+
message: '#^Method Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:request\(\) has parameter \$addHeaders with no value type specified in iterable type array\.$#'
83+
identifier: missingType.iterableValue
84+
count: 1
85+
path: src/Google/RestApi.php
86+
87+
-
88+
message: '#^Method Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:request\(\) has parameter \$options with no value type specified in iterable type array\.$#'
89+
identifier: missingType.iterableValue
90+
count: 1
91+
path: src/Google/RestApi.php
92+
93+
-
94+
message: '#^Method Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:request\(\) should return GuzzleHttp\\Psr7\\Response but returns mixed\.$#'
95+
identifier: return.type
96+
count: 1
97+
path: src/Google/RestApi.php
98+
99+
-
100+
message: '#^Parameter \#1 \$retries of method Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:decideRetry\(\) expects int, mixed given\.$#'
101+
identifier: argument.type
102+
count: 1
103+
path: src/Google/RestApi.php
104+
105+
-
106+
message: '#^Parameter \#1 \$retries of method Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:logRetryRequest\(\) expects int, mixed given\.$#'
107+
identifier: argument.type
108+
count: 1
109+
path: src/Google/RestApi.php
110+
111+
-
112+
message: '#^Property Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:\$scopes \(array\<string\>\|null\) does not accept array\.$#'
113+
identifier: assign.propertyType
114+
count: 1
115+
path: src/Google/RestApi.php
116+
117+
-
118+
message: '#^Property Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:\$serviceAccountAccessToken \(string\|null\) does not accept mixed\.$#'
119+
identifier: assign.propertyType
120+
count: 1
121+
path: src/Google/RestApi.php
122+
123+
-
124+
message: '#^Property Keboola\\Google\\ClientBundle\\Google\\RestApi\:\:\$serviceAccountConfig type has no value type specified in iterable type array\.$#'
125+
identifier: missingType.iterableValue
126+
count: 1
127+
path: src/Google/RestApi.php
128+
129+
-
130+
message: '#^Cannot call method then\(\) on mixed\.$#'
131+
identifier: method.nonObject
132+
count: 1
133+
path: src/Guzzle/RetryCallbackMiddleware.php
134+
135+
-
136+
message: '#^Cannot use \+\+ on mixed\.$#'
137+
identifier: preInc.type
138+
count: 1
139+
path: src/Guzzle/RetryCallbackMiddleware.php
140+
141+
-
142+
message: '#^Method Keboola\\Google\\ClientBundle\\Guzzle\\RetryCallbackMiddleware\:\:__invoke\(\) has parameter \$options with no value type specified in iterable type array\.$#'
143+
identifier: missingType.iterableValue
144+
count: 1
145+
path: src/Guzzle/RetryCallbackMiddleware.php
146+
147+
-
148+
message: '#^Method Keboola\\Google\\ClientBundle\\Guzzle\\RetryCallbackMiddleware\:\:__invoke\(\) should return GuzzleHttp\\Promise\\PromiseInterface but returns mixed\.$#'
149+
identifier: return.type
150+
count: 1
151+
path: src/Guzzle/RetryCallbackMiddleware.php
152+
153+
-
154+
message: '#^Method Keboola\\Google\\ClientBundle\\Guzzle\\RetryCallbackMiddleware\:\:doRetry\(\) has parameter \$options with no value type specified in iterable type array\.$#'
155+
identifier: missingType.iterableValue
156+
count: 1
157+
path: src/Guzzle/RetryCallbackMiddleware.php
158+
159+
-
160+
message: '#^Method Keboola\\Google\\ClientBundle\\Guzzle\\RetryCallbackMiddleware\:\:onFulfilled\(\) has parameter \$options with no value type specified in iterable type array\.$#'
161+
identifier: missingType.iterableValue
162+
count: 1
163+
path: src/Guzzle/RetryCallbackMiddleware.php
164+
165+
-
166+
message: '#^Method Keboola\\Google\\ClientBundle\\Guzzle\\RetryCallbackMiddleware\:\:onRejected\(\) has parameter \$options with no value type specified in iterable type array\.$#'
167+
identifier: missingType.iterableValue
168+
count: 1
169+
path: src/Guzzle/RetryCallbackMiddleware.php
170+
171+
-
172+
message: '#^Parameter \#1 \$request of method Keboola\\Google\\ClientBundle\\Guzzle\\RetryCallbackMiddleware\:\:doRetry\(\) expects Psr\\Http\\Message\\RequestInterface, mixed given\.$#'
173+
identifier: argument.type
174+
count: 1
175+
path: src/Guzzle/RetryCallbackMiddleware.php
176+
177+
-
178+
message: '#^Binary operation "\-" between mixed and 1 results in an error\.$#'
179+
identifier: binaryOp.invalid
180+
count: 1
181+
path: tests/RestApiTest.php
182+
183+
-
184+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsString\(\) with non\-falsy\-string will always evaluate to true\.$#'
185+
identifier: method.alreadyNarrowedType
186+
count: 1
187+
path: tests/RestApiTest.php
188+
189+
-
190+
message: '#^Method Keboola\\Google\\ClientBundle\\Tests\\RestApiTest\:\:getServiceAccountConfig\(\) return type has no value type specified in iterable type array\.$#'
191+
identifier: missingType.iterableValue
192+
count: 1
193+
path: tests/RestApiTest.php
194+
195+
-
196+
message: '#^Method Keboola\\Google\\ClientBundle\\Tests\\RestApiTest\:\:getServiceAccountConfig\(\) should return array but returns mixed\.$#'
197+
identifier: return.type
198+
count: 1
199+
path: tests/RestApiTest.php
200+
201+
-
202+
message: '#^Parameter \#2 \$array of method PHPUnit\\Framework\\Assert\:\:assertArrayHasKey\(\) expects array\|ArrayAccess, mixed given\.$#'
203+
identifier: argument.type
204+
count: 6
205+
path: tests/RestApiTest.php

phpstan.neon

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
includes:
2+
- phpstan-baseline.neon
13
parameters:
2-
checkMissingIterableValueType: false
4+
level: max
35
ignoreErrors:

0 commit comments

Comments
 (0)