Skip to content

Commit a23e8f1

Browse files
committed
fix php7
1 parent 80ff953 commit a23e8f1

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

tests/PHPStan/Command/ErrorFormatter/TableErrorFormatterTest.php

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ public static function dataErrorLimit(): iterable
299299
{
300300
yield [
301301
'errorsBudget' => null,
302+
'usedLevel' => CommandHelper::DEFAULT_LEVEL,
303+
'showAllErrors' => false,
302304
'expected' => ' ------ -------------------------------
303305
Line Foo.php (in context of trait)
304306
------ -------------------------------
@@ -315,6 +317,8 @@ public static function dataErrorLimit(): iterable
315317
];
316318
yield [
317319
'errorsBudget' => 1,
320+
'usedLevel' => CommandHelper::DEFAULT_LEVEL,
321+
'showAllErrors' => false,
318322
'expected' => ' ------ -------------------------------
319323
Line Foo.php (in context of trait)
320324
------ -------------------------------
@@ -325,8 +329,7 @@ public static function dataErrorLimit(): iterable
325329
[ERROR] Found 1+ errors
326330
327331
! [NOTE] Result is limited to the first 1 errors
328-
! - Pass PHPSTAN_TABLE_ERROR_FORMATTER_FORCE_SHOW_ALL_ERRORS=1
329-
! environment variable to show all errors
332+
! - Pass PHPSTAN_TABLE_ERROR_FORMATTER_FORCE_SHOW_ALL_ERRORS=1 environment variable to show all errors
330333
! - Consider using PHPStan Pro for more comfortable error browsing
331334
! Learn more: https://phpstan.com
332335
@@ -336,6 +339,7 @@ public static function dataErrorLimit(): iterable
336339
yield [
337340
'errorsBudget' => 3,
338341
'usedLevel' => '8',
342+
'showAllErrors' => false,
339343
'expected' => ' ------ -------------------------------
340344
Line Foo.php (in context of trait)
341345
------ -------------------------------
@@ -349,8 +353,7 @@ public static function dataErrorLimit(): iterable
349353
350354
! [NOTE] Result is limited to the first 3 errors
351355
! - Consider lowering the PHPStan level
352-
! - Pass PHPSTAN_TABLE_ERROR_FORMATTER_FORCE_SHOW_ALL_ERRORS=1
353-
! environment variable to show all errors
356+
! - Pass PHPSTAN_TABLE_ERROR_FORMATTER_FORCE_SHOW_ALL_ERRORS=1 environment variable to show all errors
354357
! - Consider using PHPStan Pro for more comfortable error browsing
355358
! Learn more: https://phpstan.com
356359
@@ -359,6 +362,8 @@ public static function dataErrorLimit(): iterable
359362

360363
yield [
361364
'errorsBudget' => 3,
365+
'usedLevel' => CommandHelper::DEFAULT_LEVEL,
366+
'showAllErrors' => false,
362367
'expected' => ' ------ -------------------------------
363368
Line Foo.php (in context of trait)
364369
------ -------------------------------
@@ -371,8 +376,7 @@ public static function dataErrorLimit(): iterable
371376
[ERROR] Found 3+ errors
372377
373378
! [NOTE] Result is limited to the first 3 errors
374-
! - Pass PHPSTAN_TABLE_ERROR_FORMATTER_FORCE_SHOW_ALL_ERRORS=1
375-
! environment variable to show all errors
379+
! - Pass PHPSTAN_TABLE_ERROR_FORMATTER_FORCE_SHOW_ALL_ERRORS=1 environment variable to show all errors
376380
! - Consider using PHPStan Pro for more comfortable error browsing
377381
! Learn more: https://phpstan.com
378382
@@ -381,6 +385,8 @@ public static function dataErrorLimit(): iterable
381385

382386
yield [
383387
'errorsBudget' => 4,
388+
'usedLevel' => CommandHelper::DEFAULT_LEVEL,
389+
'showAllErrors' => false,
384390
'expected' => ' ------ -------------------------------
385391
Line Foo.php (in context of trait)
386392
------ -------------------------------
@@ -397,6 +403,8 @@ public static function dataErrorLimit(): iterable
397403
];
398404
yield [
399405
'errorsBudget' => 5,
406+
'usedLevel' => CommandHelper::DEFAULT_LEVEL,
407+
'showAllErrors' => false,
400408
'expected' => ' ------ -------------------------------
401409
Line Foo.php (in context of trait)
402410
------ -------------------------------
@@ -413,6 +421,7 @@ public static function dataErrorLimit(): iterable
413421
];
414422

415423
yield [
424+
'errorsBudget' => null,
416425
'usedLevel' => '8',
417426
'showAllErrors' => true,
418427
'expected' => ' ------ -------------------------------
@@ -433,10 +442,10 @@ public static function dataErrorLimit(): iterable
433442

434443
#[DataProvider('dataErrorLimit')]
435444
public function testErrorLimit(
445+
?int $errorsBudget,
446+
string $usedLevel,
447+
bool $showAllErrors,
436448
string $expected,
437-
?int $errorsBudget = null,
438-
string $usedLevel = CommandHelper::DEFAULT_LEVEL,
439-
bool $showAllErrors = false,
440449
): void
441450
{
442451
if ($showAllErrors) {

0 commit comments

Comments
 (0)