Skip to content

Commit 082557e

Browse files
committed
Not every occurance of find() is a CLI command (#58 @gwharton)
1 parent acf1421 commit 082557e

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
# [2.5.1] = 21 January 2025
10+
### Fixed
11+
- Not every occurance of find() is a CLI command (#58 @gwharton)
12+
913
# [2.5.0] = 6 January 2025
1014
### Fixed
1115
- Prevent deps from deps to be reported #26

PhpClass/ClassInspector/CommandClassDetector.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Yireo\ExtensionChecker\PhpClass\ClassInspector;
44

55
use Magento\Framework\Console\Cli as CliApplication;
6+
use Symfony\Component\Console\Exception\CommandNotFoundException;
67

78
class CommandClassDetector implements ClassDetectorInterface
89
{
@@ -23,7 +24,12 @@ public function getClassNames(string $phpFileContent): array
2324
$classnames = [];
2425

2526
foreach ($matches[1] as $commandName) {
26-
$command = $this->cliApplication->find($commandName);
27+
try {
28+
$command = $this->cliApplication->find($commandName);
29+
} catch (CommandNotFoundException $exception) {
30+
continue;
31+
}
32+
2733
$classnames[] = get_class($command);
2834
}
2935

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "yireo/magento2-extensionchecker",
33
"license": "OSL-3.0",
44
"type": "magento2-module",
5-
"version": "2.5.0",
5+
"version": "2.5.1",
66
"homepage": "https://github.com/yireo/Yireo_ExtensionChecker",
77
"description": "Scan the code of a Magento module",
88
"keywords": [

0 commit comments

Comments
 (0)