diff --git a/phpstan.neon b/phpstan.neon index a1549cf3e80..df9c5de4e1e 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -562,3 +562,6 @@ parameters: - '#Add explicit array type to assigned "\$spreadParams" expression#' - '#foreach\(\), while\(\), for\(\) or if\(\) cannot contain a complex expression\. Extract it to a new variable on a line before#' + + # false positive + - '#Method Rector\\Php71\\Rector\\FuncCall\\RemoveExtraParametersRector\:\:resolveMaximumAllowedParameterCount\(\) should return int but returns int<0, max>\|false#' diff --git a/src/Console/Style/RectorConsoleOutputStyle.php b/src/Console/Style/RectorConsoleOutputStyle.php index 38048f9c4cd..83a3473e67a 100644 --- a/src/Console/Style/RectorConsoleOutputStyle.php +++ b/src/Console/Style/RectorConsoleOutputStyle.php @@ -7,6 +7,8 @@ use OndraM\CiDetector\CiDetector; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Helper\ProgressBar; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; final class RectorConsoleOutputStyle extends SymfonyStyle @@ -18,6 +20,16 @@ final class RectorConsoleOutputStyle extends SymfonyStyle private bool|null $isCiDetected = null; + public function __construct(InputInterface $input, OutputInterface $output) + { + parent::__construct($input, $output); + + // silent output in tests + if (defined('PHPUNIT_COMPOSER_INSTALL')) { + $this->setVerbosity(OutputInterface::VERBOSITY_QUIET); + } + } + /** * @see https://github.com/phpstan/phpstan-src/commit/0993d180e5a15a17631d525909356081be59ffeb */