File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ File: Formatter/TextCodemapFormatter.php
6868 private function formatMethod(Kauffinger\Codemap\Dto\CodemapMethodDto $methodInformation): string
6969 private function formatParameters(array $parameters): string
7070 private function formatProperty(Kauffinger\Codemap\Dto\CodemapPropertyDto $propertyInformation): string
71+ private function formatEnumCase(?string $caseValue, int|string $caseName): string
7172
7273File: Console/CodemapCommand.php
7374 Class: Kauffinger\Codemap\Console\CodemapCommand
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public function format(array $codemapData): string
3737 $ backingInfo = $ enumDto ->backingType ? ": {$ enumDto ->backingType }" : '' ;
3838 $ lines [] = " Enum: {$ enumName }{$ backingInfo }" ;
3939 foreach ($ enumDto ->cases as $ caseName => $ caseValue ) {
40- $ lines [] = $ caseValue === null ? " case { $ caseName}" : " case { $ caseName } = { $ caseValue }" ;
40+ $ lines [] = $ this -> formatEnumCase ( $ caseValue, $ caseName) ;
4141 }
4242 }
4343
@@ -85,4 +85,9 @@ private function formatProperty(CodemapPropertyDto $propertyInformation): string
8585 $ propertyInformation ->propertyName
8686 );
8787 }
88+
89+ private function formatEnumCase (?string $ caseValue , int |string $ caseName ): string
90+ {
91+ return $ caseValue === null ? " case {$ caseName }" : " case {$ caseName } = {$ caseValue }" ;
92+ }
8893}
You can’t perform that action at this time.
0 commit comments