From a5dac84e0abce77d1c5e037353d0c22c58479036 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 20 Jun 2026 18:07:28 +0200 Subject: [PATCH 1/3] bump --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 927e02c02..fd0c4fc94 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ ], "require": { "php": ">=8.4", - "entropy/entropy": "^0.4.2", + "entropy/entropy": "^0.4.6", "nette/robot-loader": "^4.1", "nette/utils": "^4.1", "nikic/php-parser": "^5.7", From efcfdd3778fc1c557e3b669471568b102cc02e6d Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 20 Jun 2026 18:12:07 +0200 Subject: [PATCH 2/3] use progress bar --- src/Command/CheckCommentedCodeCommand.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Command/CheckCommentedCodeCommand.php b/src/Command/CheckCommentedCodeCommand.php index 180bc7e19..4b5c1508a 100644 --- a/src/Command/CheckCommentedCodeCommand.php +++ b/src/Command/CheckCommentedCodeCommand.php @@ -7,6 +7,7 @@ use Entropy\Console\Contract\CommandInterface; use Entropy\Console\Enum\ExitCode; use Entropy\Console\Output\OutputPrinter; +use Entropy\Console\Output\ProgressBar; use Rector\SwissKnife\Comments\CommentedCodeAnalyzer; use Rector\SwissKnife\Finder\PhpFilesFinder; @@ -34,10 +35,15 @@ public function run(array $sources, array $skipFiles = [], int $lineLimit = self $message = sprintf('Analysing %d *.php files', count($phpFileInfos)); $this->outputPrinter->yellow($message); + $progressBar = new ProgressBar(); + $progressBar->start(count($phpFileInfos)); + $commentedLinesByFilePaths = []; foreach ($phpFileInfos as $phpFileInfo) { $commentedLines = $this->commentedCodeAnalyzer->process($phpFileInfo->getRealPath(), $lineLimit); + $progressBar->advance(); + if ($commentedLines === []) { continue; } @@ -45,6 +51,8 @@ public function run(array $sources, array $skipFiles = [], int $lineLimit = self $commentedLinesByFilePaths[$phpFileInfo->getRealPath()] = $commentedLines; } + $progressBar->finish(); + if ($commentedLinesByFilePaths === []) { $this->outputPrinter->success('No commented code found'); return ExitCode::SUCCESS; From 66f97860a505d7fc1295b5d7b1cb6aafd8dfbb42 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 20 Jun 2026 18:13:20 +0200 Subject: [PATCH 3/3] fixes --- .../NodeVisitor/FindNonPrivateClassConstNodeVisitor.php | 1 + src/Testing/UnitTestFilter.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/PhpParser/NodeVisitor/FindNonPrivateClassConstNodeVisitor.php b/src/PhpParser/NodeVisitor/FindNonPrivateClassConstNodeVisitor.php index 1b7890abe..44b0a8e34 100644 --- a/src/PhpParser/NodeVisitor/FindNonPrivateClassConstNodeVisitor.php +++ b/src/PhpParser/NodeVisitor/FindNonPrivateClassConstNodeVisitor.php @@ -68,6 +68,7 @@ private function isConstantDefinedInParentClassAlso(Class_ $class, string $const return in_array($constantName, $this->getClassConstantNames($parentClassName), true); } } + return array_any( $class->implements, fn ($implement): bool => in_array($constantName, $this->getClassConstantNames($implement->toString()), true) diff --git a/src/Testing/UnitTestFilter.php b/src/Testing/UnitTestFilter.php index 79ad0faec..bef1322c5 100644 --- a/src/Testing/UnitTestFilter.php +++ b/src/Testing/UnitTestFilter.php @@ -30,6 +30,7 @@ private function isUnitTest(string $class): bool if (! is_a($class, 'PHPUnit\Framework\TestCase', true) && ! is_a($class, 'PHPUnit_Framework_TestCase', true)) { return false; } + return array_all( self::NON_UNIT_TEST_CASE_CLASSES, fn ($nonUnitTestCaseClass): bool => ! is_a($class, $nonUnitTestCaseClass, true)