Skip to content

Commit 9507b2c

Browse files
committed
feat: refactor CreateClassCommmand.php
1 parent cf0a1ae commit 9507b2c

114 files changed

Lines changed: 489 additions & 401 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/phpmd.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ layout: home
88

99
| Priority | File | Line | Rule | Message |
1010
| -------- | ------ | ------------ | ----- | ------- |
11-
| <span class="prio3">3</span> | src/Command/CreateClassCommand.php | 184 | [UnusedLocalVariable](https://phpmd.org/rules/unusedcode.html#unusedlocalvariable) | Avoid unused local variables such as `$isEnumType`. |
11+
| <span class="prio3">3</span> | src/Command/CreateClassCommand.php | 291 | [UnusedFormalParameter](https://phpmd.org/rules/unusedcode.html#unusedformalparameter) | Avoid unused parameters such as `$type`. |
1212
| <span class="prio3">3</span> | src/Command/WatchCommand.php | 35 | [UnusedPrivateField](https://phpmd.org/rules/unusedcode.html#unusedprivatefield) | Avoid unused private fields such as `$data`. |
1313
| <span class="prio3">3</span> | src/Command/WatchCommand.php | 215 | [UnusedPrivateMethod](https://phpmd.org/rules/unusedcode.html#unusedprivatemethod) | Avoid unused private methods such as `parseFile`. |
1414
| <span class="prio3">3</span> | src/Command/WatchCommand.php | 215 | [UnusedFormalParameter](https://phpmd.org/rules/unusedcode.html#unusedformalparameter) | Avoid unused parameters such as `$generator`. |
@@ -23,7 +23,7 @@ Issues detected: 9
2323

2424
| Priority | File | Line | Rule | Message |
2525
| -------- | ------ | ------------ | ----- | ------- |
26-
| <span class="prio3">3</span> | src/Command/CreateClassCommand.php | 21 | [ExcessiveClassComplexity](https://phpmd.org/rules/codesize.html#excessiveclasscomplexity) | The class CreateClassCommand has an overall complexity of 57 which is very high. The configured complexity threshold is 50. |
26+
| <span class="prio3">3</span> | src/Command/CreateClassCommand.php | 21 | [ExcessiveClassComplexity](https://phpmd.org/rules/codesize.html#excessiveclasscomplexity) | The class CreateClassCommand has an overall complexity of 69 which is very high. The configured complexity threshold is 50. |
2727
| <span class="prio3">3</span> | src/Command/CreateEnumCommand.php | 28 | [CyclomaticComplexity](https://phpmd.org/rules/codesize.html#cyclomaticcomplexity) | The method __invoke() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. |
2828
| <span class="prio3">3</span> | src/Command/WatchCommand.php | 51 | [CyclomaticComplexity](https://phpmd.org/rules/codesize.html#cyclomaticcomplexity) | The method __invoke() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10. |
2929
| <span class="prio3">3</span> | src/Command/WatchCommand.php | 51 | [NPathComplexity](https://phpmd.org/rules/codesize.html#npathcomplexity) | The method __invoke() has an NPath complexity of 768. The configured NPath complexity threshold is 200. |
@@ -44,10 +44,10 @@ Issues detected: 15
4444

4545
| Priority | File | Line | Rule | Message |
4646
| -------- | ------ | ------------ | ----- | ------- |
47-
| <span class="prio1">1</span> | src/Command/CreateClassCommand.php | 36 | [StaticAccess](https://phpmd.org/rules/cleancode.html#staticaccess) | Avoid using static access to class `\Symfony\Component\Yaml\Yaml` in method `__invoke`. |
48-
| <span class="prio1">1</span> | src/Command/CreateClassCommand.php | 257 | [ElseExpression](https://phpmd.org/rules/cleancode.html#elseexpression) | The method getMethods uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. |
49-
| <span class="prio1">1</span> | src/Command/CreateClassCommand.php | 362 | [ElseExpression](https://phpmd.org/rules/cleancode.html#elseexpression) | The method getAttributeComment uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. |
50-
| <span class="prio1">1</span> | src/Command/CreateClassCommand.php | 424 | [StaticAccess](https://phpmd.org/rules/cleancode.html#staticaccess) | Avoid using static access to class `\Html\Helper\Helper` in method `getClassName`. |
47+
| <span class="prio1">1</span> | src/Command/CreateClassCommand.php | 91 | [StaticAccess](https://phpmd.org/rules/cleancode.html#staticaccess) | Avoid using static access to class `\Symfony\Component\Yaml\Yaml` in method `loadHtmlDefinitions`. |
48+
| <span class="prio1">1</span> | src/Command/CreateClassCommand.php | 397 | [ElseExpression](https://phpmd.org/rules/cleancode.html#elseexpression) | The method processEnumAttribute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. |
49+
| <span class="prio1">1</span> | src/Command/CreateClassCommand.php | 456 | [StaticAccess](https://phpmd.org/rules/cleancode.html#staticaccess) | Avoid using static access to class `\Html\Helper\Helper` in method `getClassName`. |
50+
| <span class="prio1">1</span> | src/Command/CreateClassCommand.php | 482 | [ElseExpression](https://phpmd.org/rules/cleancode.html#elseexpression) | The method getAttributeComment uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. |
5151
| <span class="prio1">1</span> | src/Command/CreateEnumCommand.php | 38 | [StaticAccess](https://phpmd.org/rules/cleancode.html#staticaccess) | Avoid using static access to class `\Symfony\Component\Yaml\Yaml` in method `__invoke`. |
5252
| <span class="prio1">1</span> | src/Command/CreateJsonCommand.php | 31 | [StaticAccess](https://phpmd.org/rules/cleancode.html#staticaccess) | Avoid using static access to class `\Symfony\Component\Yaml\Yaml` in method `__invoke`. |
5353
| <span class="prio1">1</span> | src/Command/WatchCommand.php | 55 | [BooleanArgumentFlag](https://phpmd.org/rules/cleancode.html#booleanargumentflag) | The method __invoke has a boolean flag argument $overwriteExisting, which is a certain sign of a Single Responsibility Principle violation. |
@@ -137,4 +137,4 @@ Issues detected: 75
137137

138138
Issues detected: 9
139139

140-
Mo 4. Aug 00:29:47 CEST 2025
140+
Di 5. Aug 08:12:56 CEST 2025

0 commit comments

Comments
 (0)