@@ -46,9 +46,8 @@ public function handle(): void
46
46
$ this ->checkDirectory ($ this ->enumNamespace );
47
47
$ this ->checkClassExist ($ this ->relativeEnumsPath , $ enumName , 'Enum ' );
48
48
49
- $ enumCreator = new CreatorEnum ($ columns , $ attributeStub , $ enum , $ enumName , $ this ->enumNamespace );
50
- $ creator = new BaseCreator ($ enumCreator );
51
- $ baseContent = $ creator ->createClass ($ filenameWithPath , $ this );
49
+ $ baseContent = $ this ->getBaseCreator ($ columns , $ attributeStub , $ enum , $ enumName )
50
+ ->createClass ($ filenameWithPath , $ this );
52
51
53
52
$ this ->finalized ($ filenameWithPath , $ enumName , $ baseContent );
54
53
}
@@ -95,4 +94,18 @@ private function extractEnumValues($columnType): array
95
94
96
95
return array_filter ($ items );
97
96
}
97
+
98
+ /**
99
+ * @param Collection $columns
100
+ * @param bool|string $attributeStub
101
+ * @param mixed $enum
102
+ * @param int|string $enumName
103
+ * @return BaseCreator
104
+ */
105
+ private function getBaseCreator (Collection $ columns , bool |string $ attributeStub , mixed $ enum , int |string $ enumName ): BaseCreator
106
+ {
107
+ $ enumCreator = new CreatorEnum ($ columns , $ attributeStub , $ enum , $ enumName , $ this ->enumNamespace );
108
+
109
+ return new BaseCreator ($ enumCreator );
110
+ }
98
111
}
0 commit comments