Skip to content

Commit 4b92cd0

Browse files
committed
#31176: Fixed phpstan errorFormatter and deprecated autoload config keys
1 parent 9b36799 commit 4b92cd0

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use PHPStan\Command\AnalysisResult;
1111
use PHPStan\Command\ErrorFormatter\TableErrorFormatter;
12+
use PHPStan\Command\ErrorFormatter\ErrorFormatter;
1213
use PHPStan\Command\Output;
1314

1415
/**
@@ -37,12 +38,22 @@
3738
*
3839
* @see \Magento\PhpStan\Formatters\Fixtures\ClassWithIgnoreAnnotation
3940
*/
40-
class FilteredErrorFormatter extends TableErrorFormatter
41+
class FilteredErrorFormatter implements ErrorFormatter
4142
{
4243
private const MUTE_ERROR_ANNOTATION = 'phpstan:ignore';
4344

4445
private const NO_ERRORS = 0;
4546

47+
private $tableErrorFormatter;
48+
49+
/**
50+
* @param TableErrorFormatter $tableErrorFormatter
51+
*/
52+
public function __construct(TableErrorFormatter $tableErrorFormatter)
53+
{
54+
$this->tableErrorFormatter = $tableErrorFormatter;
55+
}
56+
4657
/**
4758
* @inheritdoc
4859
*/
@@ -67,7 +78,7 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
6778
$analysisResult->getProjectConfigFile()
6879
);
6980

70-
return parent::formatErrors($clearedAnalysisResult, $output);
81+
return $this->tableErrorFormatter->formatErrors($clearedAnalysisResult, $output);
7182
}
7283

7384
/**

dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ parameters:
99
- %rootDir%/../../../dev/tests/*/tmp/*
1010
- %rootDir%/../../../dev/tests/*/_generated/*
1111
- %rootDir%/../../../pub/*
12-
autoload_directories:
12+
scanDirectories:
1313
- %rootDir%/../../../dev/tests/static/framework/tests/unit/testsuite/Magento
1414
- %rootDir%/../../../dev/tests/integration/framework/tests/unit/testsuite/Magento
1515
- %rootDir%/../../../dev/tests/api-functional/_files/Magento
16-
autoload_files:
16+
bootstrapFiles:
1717
- %rootDir%/../../../dev/tests/static/framework/autoload.php
1818
- %rootDir%/../../../dev/tests/integration/framework/autoload.php
1919
- %rootDir%/../../../dev/tests/api-functional/framework/autoload.php
@@ -46,7 +46,4 @@ services:
4646
errorFormatter.filtered:
4747
class: Magento\PhpStan\Formatters\FilteredErrorFormatter
4848
arguments:
49-
showTipsOfTheDay: false
50-
checkThisOnly: false
51-
inferPrivatePropertyTypeFromConstructor: true
52-
checkMissingTypehints: %checkMissingTypehints%
49+
tableErrorFormatter: @errorFormatter.table

0 commit comments

Comments
 (0)