Skip to content

Commit 82930a9

Browse files
committed
fix Auth @param and @returns following phpstan l2
1 parent 403f60f commit 82930a9

3 files changed

Lines changed: 256 additions & 4 deletions

File tree

phpstan-baseline.neon

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
parameters:
22
ignoreErrors:
3+
-
4+
rawMessage: Access to an undefined property Leaf\Auth\User::$email.
5+
identifier: property.notFound
6+
count: 1
7+
path: src/Auth.php
8+
39
-
410
rawMessage: 'Call to static method error() on an unknown class Leaf\Exception\General.'
511
identifier: class.notFound
@@ -24,6 +30,24 @@ parameters:
2430
count: 1
2531
path: src/Auth.php
2632

33+
-
34+
rawMessage: 'Method Leaf\Auth::client() has invalid return type League\OAuth2\Client\Provider\AbstractProvider.'
35+
identifier: class.notFound
36+
count: 1
37+
path: src/Auth.php
38+
39+
-
40+
rawMessage: 'Parameter $client of method Leaf\Auth::withProvider() has invalid type League\OAuth2\Client\Provider\AbstractProvider.'
41+
identifier: class.notFound
42+
count: 1
43+
path: src/Auth.php
44+
45+
-
46+
rawMessage: 'Variable $credentials in isset() is never defined.'
47+
identifier: isset.variable
48+
count: 2
49+
path: src/Auth.php
50+
2751
-
2852
rawMessage: Access to constant STATUS_ACTIVE on an unknown class Leaf\Billing\Subscription.
2953
identifier: class.notFound
@@ -66,12 +90,174 @@ parameters:
6690
count: 1
6791
path: src/functions.php
6892

93+
-
94+
rawMessage: Access to an undefined property Leaf\Auth\User::$username.
95+
identifier: property.notFound
96+
count: 2
97+
path: tests/login.test.php
98+
99+
-
100+
rawMessage: 'Call to method not() of internal class Pest\Expectation from outside its root namespace Pest.'
101+
identifier: method.internalClass
102+
count: 1
103+
path: tests/login.test.php
104+
105+
-
106+
rawMessage: 'Call to method toBe() of internal class Pest\Expectation from outside its root namespace Pest.'
107+
identifier: method.internalClass
108+
count: 4
109+
path: tests/login.test.php
110+
111+
-
112+
rawMessage: 'Call to method toBeFalse() of internal class Pest\Expectation from outside its root namespace Pest.'
113+
identifier: method.internalClass
114+
count: 2
115+
path: tests/login.test.php
116+
117+
-
118+
rawMessage: 'Call to method toBeInstanceOf() of internal class Pest\Expectation from outside its root namespace Pest.'
119+
identifier: method.internalClass
120+
count: 2
121+
path: tests/login.test.php
122+
123+
-
124+
rawMessage: 'Call to method toBeNull() of internal class Pest\Expectation from outside its root namespace Pest.'
125+
identifier: method.internalClass
126+
count: 2
127+
path: tests/login.test.php
128+
129+
-
130+
rawMessage: 'Call to method toBeNull() of internal class Pest\Expectation<mixed> from outside its root namespace Pest.'
131+
identifier: method.internalClass
132+
count: 1
133+
path: tests/login.test.php
134+
135+
-
136+
rawMessage: 'Call to method toBeString() of internal class Pest\Expectation from outside its root namespace Pest.'
137+
identifier: method.internalClass
138+
count: 2
139+
path: tests/login.test.php
140+
141+
-
142+
rawMessage: 'Call to method toBeTrue() of internal class Pest\Expectation from outside its root namespace Pest.'
143+
identifier: method.internalClass
144+
count: 3
145+
path: tests/login.test.php
146+
147+
-
148+
rawMessage: Access to an undefined property Leaf\Auth\User::$password.
149+
identifier: property.notFound
150+
count: 2
151+
path: tests/register.test.php
152+
153+
-
154+
rawMessage: Access to an undefined property Leaf\Auth\User::$username.
155+
identifier: property.notFound
156+
count: 2
157+
path: tests/register.test.php
158+
159+
-
160+
rawMessage: 'Call to method not() of internal class Pest\Expectation from outside its root namespace Pest.'
161+
identifier: method.internalClass
162+
count: 1
163+
path: tests/register.test.php
164+
165+
-
166+
rawMessage: 'Call to method toBe() of internal class Pest\Expectation from outside its root namespace Pest.'
167+
identifier: method.internalClass
168+
count: 3
169+
path: tests/register.test.php
170+
171+
-
172+
rawMessage: 'Call to method toBe() of internal class Pest\Expectation<mixed> from outside its root namespace Pest.'
173+
identifier: method.internalClass
174+
count: 1
175+
path: tests/register.test.php
176+
177+
-
178+
rawMessage: 'Call to method toBeFalse() of internal class Pest\Expectation from outside its root namespace Pest.'
179+
identifier: method.internalClass
180+
count: 1
181+
path: tests/register.test.php
182+
183+
-
184+
rawMessage: 'Call to method toBeInstanceOf() of internal class Pest\Expectation from outside its root namespace Pest.'
185+
identifier: method.internalClass
186+
count: 2
187+
path: tests/register.test.php
188+
189+
-
190+
rawMessage: 'Call to method toBeTrue() of internal class Pest\Expectation from outside its root namespace Pest.'
191+
identifier: method.internalClass
192+
count: 6
193+
path: tests/register.test.php
194+
69195
-
70196
rawMessage: 'Undefined variable: $this'
71197
identifier: variable.undefined
72198
count: 1
73199
path: tests/register.test.php
74200

201+
-
202+
rawMessage: Access to an undefined property Leaf\Auth\User::$username.
203+
identifier: property.notFound
204+
count: 6
205+
path: tests/session.test.php
206+
207+
-
208+
rawMessage: 'Call to method not() of internal class Pest\Expectation from outside its root namespace Pest.'
209+
identifier: method.internalClass
210+
count: 1
211+
path: tests/session.test.php
212+
213+
-
214+
rawMessage: 'Call to method toBe() of internal class Pest\Expectation from outside its root namespace Pest.'
215+
identifier: method.internalClass
216+
count: 20
217+
path: tests/session.test.php
218+
219+
-
220+
rawMessage: 'Call to method toBe() of internal class Pest\Expectation<mixed> from outside its root namespace Pest.'
221+
identifier: method.internalClass
222+
count: 1
223+
path: tests/session.test.php
224+
225+
-
226+
rawMessage: 'Call to method toBeGreaterThan() of internal class Pest\Expectation from outside its root namespace Pest.'
227+
identifier: method.internalClass
228+
count: 1
229+
path: tests/session.test.php
230+
231+
-
232+
rawMessage: 'Call to method toBeInstanceOf() of internal class Pest\Expectation from outside its root namespace Pest.'
233+
identifier: method.internalClass
234+
count: 8
235+
path: tests/session.test.php
236+
237+
-
238+
rawMessage: 'Call to method toBeNull() of internal class Pest\Expectation from outside its root namespace Pest.'
239+
identifier: method.internalClass
240+
count: 6
241+
path: tests/session.test.php
242+
243+
-
244+
rawMessage: 'Call to method toBeTrue() of internal class Pest\Expectation from outside its root namespace Pest.'
245+
identifier: method.internalClass
246+
count: 8
247+
path: tests/session.test.php
248+
249+
-
250+
rawMessage: Access to an undefined property Leaf\Auth\User::$username.
251+
identifier: property.notFound
252+
count: 2
253+
path: tests/table.test.php
254+
255+
-
256+
rawMessage: 'Call to method toBe() of internal class Pest\Expectation from outside its root namespace Pest.'
257+
identifier: method.internalClass
258+
count: 5
259+
path: tests/table.test.php
260+
75261
-
76262
rawMessage: Function createUsersTable not found.
77263
identifier: function.notFound
@@ -84,12 +270,78 @@ parameters:
84270
count: 5
85271
path: tests/table.test.php
86272

273+
-
274+
rawMessage: Access to an undefined property Leaf\Auth\User::$username.
275+
identifier: property.notFound
276+
count: 2
277+
path: tests/update.test.php
278+
279+
-
280+
rawMessage: 'Call to method not() of internal class Pest\Expectation from outside its root namespace Pest.'
281+
identifier: method.internalClass
282+
count: 2
283+
path: tests/update.test.php
284+
285+
-
286+
rawMessage: 'Call to method toBe() of internal class Pest\Expectation from outside its root namespace Pest.'
287+
identifier: method.internalClass
288+
count: 3
289+
path: tests/update.test.php
290+
291+
-
292+
rawMessage: 'Call to method toBe() of internal class Pest\Expectation<mixed> from outside its root namespace Pest.'
293+
identifier: method.internalClass
294+
count: 2
295+
path: tests/update.test.php
296+
297+
-
298+
rawMessage: 'Call to method toBeFalse() of internal class Pest\Expectation from outside its root namespace Pest.'
299+
identifier: method.internalClass
300+
count: 1
301+
path: tests/update.test.php
302+
303+
-
304+
rawMessage: 'Call to method toBeTrue() of internal class Pest\Expectation from outside its root namespace Pest.'
305+
identifier: method.internalClass
306+
count: 1
307+
path: tests/update.test.php
308+
87309
-
88310
rawMessage: 'Undefined variable: $this'
89311
identifier: variable.undefined
90312
count: 7
91313
path: tests/update.test.php
92314

315+
-
316+
rawMessage: Access to an undefined property Leaf\Auth\User::$username.
317+
identifier: property.notFound
318+
count: 2
319+
path: tests/user.test.php
320+
321+
-
322+
rawMessage: 'Call to method toBe() of internal class Pest\Expectation from outside its root namespace Pest.'
323+
identifier: method.internalClass
324+
count: 2
325+
path: tests/user.test.php
326+
327+
-
328+
rawMessage: 'Call to method toBeInstanceOf() of internal class Pest\Expectation from outside its root namespace Pest.'
329+
identifier: method.internalClass
330+
count: 3
331+
path: tests/user.test.php
332+
333+
-
334+
rawMessage: 'Call to method toBeNull() of internal class Pest\Expectation from outside its root namespace Pest.'
335+
identifier: method.internalClass
336+
count: 1
337+
path: tests/user.test.php
338+
339+
-
340+
rawMessage: 'Call to method toBeTrue() of internal class Pest\Expectation from outside its root namespace Pest.'
341+
identifier: method.internalClass
342+
count: 2
343+
path: tests/user.test.php
344+
93345
-
94346
rawMessage: 'Undefined variable: $this'
95347
identifier: variable.undefined

phpstan.dist.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ includes:
33
- phpstan-baseline.neon
44

55
parameters:
6-
level: 0
6+
level: 2
77
paths:
88
- src
99
- tests

src/Auth.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function autoConnect(array $pdoOptions = [])
142142
* Pass in db connection instance directly
143143
*
144144
* @param \PDO $connection A connection instance of your db
145-
* @return $this;
145+
* @return $this
146146
*/
147147
public function dbConnection(\PDO $connection)
148148
{
@@ -553,7 +553,7 @@ public function find($id)
553553
* ---
554554
* Create an account for another user
555555
*
556-
* @param array The user details to save
556+
* @param array $userData The user details to save
557557
*/
558558
public function createUserFor($userData)
559559
{
@@ -619,7 +619,7 @@ public function oauthToken()
619619
* ---
620620
* Sign out the currently authenticated user
621621
*
622-
* @param string|array|callable|null $redirectUrl Redirect to this url after logout
622+
* @param string|array|callable|null $action Redirect to this url after logout
623623
* @return bool
624624
*/
625625
public function logout($action = null): bool

0 commit comments

Comments
 (0)