You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -34,7 +32,6 @@ protected function shouldTreatPhpDocTypesAsCertain(): bool
34
32
35
33
publicfunctiontestInstanceof(): void
36
34
{
37
-
$this->checkAlwaysTrueInstanceOf = true;
38
35
$this->treatPhpDocTypesAsCertain = true;
39
36
$tipText = 'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.';
40
37
$this->analyse(
@@ -195,107 +192,8 @@ public function testInstanceof(): void
$tipText = 'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.';
204
-
$this->analyse(
205
-
[__DIR__ . '/data/impossible-instanceof.php'],
206
-
[
207
-
[
208
-
'Instanceof between ImpossibleInstanceOf\Dolor and ImpossibleInstanceOf\Lorem will always evaluate to false.',
209
-
71,
210
-
],
211
-
[
212
-
'Instanceof between string and ImpossibleInstanceOf\Foo will always evaluate to false.',
213
-
94,
214
-
],
215
-
[
216
-
'Instanceof between string and \'str\' will always evaluate to false.',
217
-
98,
218
-
],
219
-
[
220
-
'Instanceof between ImpossibleInstanceOf\Test|null and ImpossibleInstanceOf\Lorem will always evaluate to false.',
221
-
119,
222
-
],
223
-
[
224
-
'Instanceof between ImpossibleInstanceOf\Test|null and ImpossibleInstanceOf\Lorem will always evaluate to false.',
225
-
137,
226
-
],
227
-
[
228
-
'Instanceof between ImpossibleInstanceOf\Test|null and ImpossibleInstanceOf\Lorem will always evaluate to false.',
229
-
155,
230
-
],
231
-
[
232
-
'Instanceof between callable and ImpossibleInstanceOf\FinalClassWithoutInvoke will always evaluate to false.',
233
-
204,
234
-
],
235
-
[
236
-
'Instanceof between *NEVER* and ImpossibleInstanceOf\Lorem will always evaluate to false.',
237
-
228,
238
-
],
239
-
[
240
-
'Instanceof between *NEVER* and ImpossibleInstanceOf\Foo will always evaluate to false.',
241
-
234,
242
-
],
243
-
[
244
-
'Instanceof between *NEVER* and ImpossibleInstanceOf\Bar will always evaluate to false.',
245
-
240,
246
-
//$tipText,
247
-
],
248
-
[
249
-
'Instanceof between object and Exception will always evaluate to false.',
250
-
303,
251
-
],
252
-
[
253
-
'Instanceof between object and InvalidArgumentException will always evaluate to false.',
254
-
307,
255
-
],
256
-
[
257
-
'Instanceof between ImpossibleInstanceOf\Bar and ImpossibleInstanceOf\BarChild will always evaluate to false.',
258
-
318,
259
-
],
260
-
[
261
-
'Instanceof between ImpossibleInstanceOf\Bar and ImpossibleInstanceOf\BarGrandChild will always evaluate to false.',
262
-
322,
263
-
],
264
-
/*[
265
-
'Instanceof between mixed and int results in an error.',
266
-
353,
267
-
],
268
-
[
269
-
'Instanceof between mixed and ImpossibleInstanceOf\InvalidTypeTest|int results in an error.',
270
-
362,
271
-
],*/
272
-
[
273
-
'Instanceof between T of Exception and Error will always evaluate to false.',
274
-
404,
275
-
$tipText,
276
-
],
277
-
[
278
-
'Instanceof between class-string<DateTimeInterface> and DateTimeInterface will always evaluate to false.',
279
-
418,
280
-
$tipText,
281
-
],
282
-
[
283
-
'Instanceof between class-string<DateTimeInterface> and class-string<DateTimeInterface> will always evaluate to false.',
284
-
419,
285
-
$tipText,
286
-
],
287
-
[
288
-
'Instanceof between class-string<DateTimeInterface> and \'DateTimeInterface\' will always evaluate to false.',
@@ -454,7 +344,6 @@ public function testIfBranchesDoNotReportPhpDoc(): void
454
344
455
345
publicfunctiontestIfBranchesReportPhpDoc(): void
456
346
{
457
-
$this->checkAlwaysTrueInstanceOf = true;
458
347
$this->treatPhpDocTypesAsCertain = true;
459
348
$tipText = 'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.';
@@ -528,7 +415,6 @@ public function testTernaryElseDoNotReportPhpDoc(): void
528
415
529
416
publicfunctiontestTernaryElseReportPhpDoc(): void
530
417
{
531
-
$this->checkAlwaysTrueInstanceOf = true;
532
418
$this->treatPhpDocTypesAsCertain = true;
533
419
$tipText = 'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.';
@@ -614,7 +497,6 @@ public function testBug10201(): void
614
497
615
498
publicfunctiontestBug3632(): void
616
499
{
617
-
$this->checkAlwaysTrueInstanceOf = true;
618
500
$this->treatPhpDocTypesAsCertain = true;
619
501
620
502
$tipText = 'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.';
"Loose comparison using == between 0 and '1' will always evaluate to false.",
36
-
20,
37
-
],
38
-
[
39
-
"Loose comparison using == between 0 and '1' will always evaluate to false.",
40
-
27,
41
-
],
42
-
[
43
-
"Loose comparison using == between 0 and '1' will always evaluate to false.",
44
-
33,
45
-
],
46
-
[
47
-
'Loose comparison using != between 3 and 3 will always evaluate to false.',
48
-
48,
49
-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
0 commit comments