Skip to content

Commit

Permalink
#31176: Fixed phpstan errorFormatter and deprecated autoload config keys
Browse files Browse the repository at this point in the history
  • Loading branch information
sivaschenko committed Feb 18, 2021
1 parent 9b36799 commit 4b92cd0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use PHPStan\Command\AnalysisResult;
use PHPStan\Command\ErrorFormatter\TableErrorFormatter;
use PHPStan\Command\ErrorFormatter\ErrorFormatter;
use PHPStan\Command\Output;

/**
Expand Down Expand Up @@ -37,12 +38,22 @@
*
* @see \Magento\PhpStan\Formatters\Fixtures\ClassWithIgnoreAnnotation
*/
class FilteredErrorFormatter extends TableErrorFormatter
class FilteredErrorFormatter implements ErrorFormatter
{
private const MUTE_ERROR_ANNOTATION = 'phpstan:ignore';

private const NO_ERRORS = 0;

private $tableErrorFormatter;

/**
* @param TableErrorFormatter $tableErrorFormatter
*/
public function __construct(TableErrorFormatter $tableErrorFormatter)
{
$this->tableErrorFormatter = $tableErrorFormatter;
}

/**
* @inheritdoc
*/
Expand All @@ -67,7 +78,7 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
$analysisResult->getProjectConfigFile()
);

return parent::formatErrors($clearedAnalysisResult, $output);
return $this->tableErrorFormatter->formatErrors($clearedAnalysisResult, $output);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ parameters:
- %rootDir%/../../../dev/tests/*/tmp/*
- %rootDir%/../../../dev/tests/*/_generated/*
- %rootDir%/../../../pub/*
autoload_directories:
scanDirectories:
- %rootDir%/../../../dev/tests/static/framework/tests/unit/testsuite/Magento
- %rootDir%/../../../dev/tests/integration/framework/tests/unit/testsuite/Magento
- %rootDir%/../../../dev/tests/api-functional/_files/Magento
autoload_files:
bootstrapFiles:
- %rootDir%/../../../dev/tests/static/framework/autoload.php
- %rootDir%/../../../dev/tests/integration/framework/autoload.php
- %rootDir%/../../../dev/tests/api-functional/framework/autoload.php
Expand Down Expand Up @@ -46,7 +46,4 @@ services:
errorFormatter.filtered:
class: Magento\PhpStan\Formatters\FilteredErrorFormatter
arguments:
showTipsOfTheDay: false
checkThisOnly: false
inferPrivatePropertyTypeFromConstructor: true
checkMissingTypehints: %checkMissingTypehints%
tableErrorFormatter: @errorFormatter.table

0 comments on commit 4b92cd0

Please sign in to comment.