Skip to content

Commit b94245d

Browse files
committed
remove implicit false to string conversion in User::__toString
1 parent c080d0f commit b94245d

3 files changed

Lines changed: 176 additions & 2 deletions

File tree

phpstan-baseline.neon

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,60 @@ parameters:
6666
count: 2
6767
path: tests/login.test.php
6868

69+
-
70+
rawMessage: Access to an undefined property object::$accessToken.
71+
identifier: property.notFound
72+
count: 1
73+
path: tests/login.test.php
74+
75+
-
76+
rawMessage: Access to an undefined property object::$refreshToken.
77+
identifier: property.notFound
78+
count: 1
79+
path: tests/login.test.php
80+
81+
-
82+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::not().'
83+
identifier: method.notFound
84+
count: 1
85+
path: tests/login.test.php
86+
87+
-
88+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBe().'
89+
identifier: method.notFound
90+
count: 4
91+
path: tests/login.test.php
92+
93+
-
94+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeFalse().'
95+
identifier: method.notFound
96+
count: 2
97+
path: tests/login.test.php
98+
99+
-
100+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeInstanceOf().'
101+
identifier: method.notFound
102+
count: 2
103+
path: tests/login.test.php
104+
105+
-
106+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeNull().'
107+
identifier: method.notFound
108+
count: 2
109+
path: tests/login.test.php
110+
111+
-
112+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeString().'
113+
identifier: method.notFound
114+
count: 2
115+
path: tests/login.test.php
116+
117+
-
118+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeTrue().'
119+
identifier: method.notFound
120+
count: 3
121+
path: tests/login.test.php
122+
69123
-
70124
rawMessage: 'Call to method not() of internal class Pest\Expectation from outside its root namespace Pest.'
71125
identifier: method.internalClass
@@ -126,6 +180,36 @@ parameters:
126180
count: 2
127181
path: tests/register.test.php
128182

183+
-
184+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::not().'
185+
identifier: method.notFound
186+
count: 1
187+
path: tests/register.test.php
188+
189+
-
190+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBe().'
191+
identifier: method.notFound
192+
count: 3
193+
path: tests/register.test.php
194+
195+
-
196+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeFalse().'
197+
identifier: method.notFound
198+
count: 1
199+
path: tests/register.test.php
200+
201+
-
202+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeInstanceOf().'
203+
identifier: method.notFound
204+
count: 2
205+
path: tests/register.test.php
206+
207+
-
208+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeTrue().'
209+
identifier: method.notFound
210+
count: 6
211+
path: tests/register.test.php
212+
129213
-
130214
rawMessage: 'Call to method not() of internal class Pest\Expectation from outside its root namespace Pest.'
131215
identifier: method.internalClass
@@ -174,6 +258,42 @@ parameters:
174258
count: 6
175259
path: tests/session.test.php
176260

261+
-
262+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::not().'
263+
identifier: method.notFound
264+
count: 1
265+
path: tests/session.test.php
266+
267+
-
268+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBe().'
269+
identifier: method.notFound
270+
count: 20
271+
path: tests/session.test.php
272+
273+
-
274+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeGreaterThan().'
275+
identifier: method.notFound
276+
count: 1
277+
path: tests/session.test.php
278+
279+
-
280+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeInstanceOf().'
281+
identifier: method.notFound
282+
count: 8
283+
path: tests/session.test.php
284+
285+
-
286+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeNull().'
287+
identifier: method.notFound
288+
count: 6
289+
path: tests/session.test.php
290+
291+
-
292+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeTrue().'
293+
identifier: method.notFound
294+
count: 8
295+
path: tests/session.test.php
296+
177297
-
178298
rawMessage: 'Call to method not() of internal class Pest\Expectation from outside its root namespace Pest.'
179299
identifier: method.internalClass
@@ -222,6 +342,12 @@ parameters:
222342
count: 2
223343
path: tests/table.test.php
224344

345+
-
346+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBe().'
347+
identifier: method.notFound
348+
count: 5
349+
path: tests/table.test.php
350+
225351
-
226352
rawMessage: 'Call to method toBe() of internal class Pest\Expectation from outside its root namespace Pest.'
227353
identifier: method.internalClass
@@ -252,6 +378,30 @@ parameters:
252378
count: 2
253379
path: tests/update.test.php
254380

381+
-
382+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::not().'
383+
identifier: method.notFound
384+
count: 2
385+
path: tests/update.test.php
386+
387+
-
388+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBe().'
389+
identifier: method.notFound
390+
count: 3
391+
path: tests/update.test.php
392+
393+
-
394+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeFalse().'
395+
identifier: method.notFound
396+
count: 1
397+
path: tests/update.test.php
398+
399+
-
400+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeTrue().'
401+
identifier: method.notFound
402+
count: 1
403+
path: tests/update.test.php
404+
255405
-
256406
rawMessage: 'Call to method not() of internal class Pest\Expectation from outside its root namespace Pest.'
257407
identifier: method.internalClass
@@ -294,6 +444,30 @@ parameters:
294444
count: 2
295445
path: tests/user.test.php
296446

447+
-
448+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBe().'
449+
identifier: method.notFound
450+
count: 2
451+
path: tests/user.test.php
452+
453+
-
454+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeInstanceOf().'
455+
identifier: method.notFound
456+
count: 3
457+
path: tests/user.test.php
458+
459+
-
460+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeNull().'
461+
identifier: method.notFound
462+
count: 1
463+
path: tests/user.test.php
464+
465+
-
466+
rawMessage: 'Call to an undefined method Pest\Expectation|Pest\Support\Extendable::toBeTrue().'
467+
identifier: method.notFound
468+
count: 2
469+
path: tests/user.test.php
470+
297471
-
298472
rawMessage: 'Call to method toBe() of internal class Pest\Expectation from outside its root namespace Pest.'
299473
identifier: method.internalClass

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: 6
6+
level: 7
77
paths:
88
- src
99
- tests

src/Auth/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public function setDb($db)
265265

266266
public function __toString()
267267
{
268-
return json_encode($this->get());
268+
return json_encode($this->get()) ?: '';
269269
}
270270

271271
/**

0 commit comments

Comments
 (0)