@@ -23,18 +23,14 @@ class GeneratorField
23
23
public bool $ inForm = true ;
24
24
public bool $ inIndex = true ;
25
25
public bool $ inView = true ;
26
+ public bool $ isNotNull = false ;
26
27
27
28
public string $ migrationText = '' ;
28
29
public string $ foreignKeyText = '' ;
29
30
30
- public bool $ isNotNull = false ;
31
-
32
31
public int $ numberDecimalPoints = 2 ;
33
32
34
- /**
35
- * @param $dbInput
36
- */
37
- public function parseDBType ($ dbInput )
33
+ public function parseDBType (string $ dbInput )
38
34
{
39
35
if (!Str::contains ($ dbInput , ': ' )) {
40
36
$ this ->dbType = $ dbInput ;
@@ -64,7 +60,7 @@ public function parseDBType($dbInput)
64
60
$ this ->prepareMigrationText ();
65
61
}
66
62
67
- public function parseHtmlInput ($ htmlInput )
63
+ public function parseHtmlInput (string $ htmlInput )
68
64
{
69
65
if (empty ($ htmlInput )) {
70
66
$ this ->htmlType = 'text ' ;
@@ -83,7 +79,7 @@ public function parseHtmlInput($htmlInput)
83
79
$ this ->htmlValues = explode (', ' , implode (': ' , $ htmlInputArr ));
84
80
}
85
81
86
- public function parseOptions ($ options )
82
+ public function parseOptions (string $ options )
87
83
{
88
84
$ options = strtolower ($ options );
89
85
$ optionsArr = explode (', ' , $ options );
@@ -209,7 +205,7 @@ public static function parseFieldFromConsoleInput(string $fieldInput, string $va
209
205
return $ field ;
210
206
}
211
207
212
- public static function parseFieldFromFile ($ fieldInput ): self
208
+ public static function parseFieldFromFile (array $ fieldInput ): self
213
209
{
214
210
$ field = new self ();
215
211
$ field ->name = $ fieldInput ['name ' ];
@@ -230,12 +226,12 @@ public static function parseFieldFromFile($fieldInput): self
230
226
return $ field ;
231
227
}
232
228
233
- public function getTitle ()
229
+ public function getTitle (): string
234
230
{
235
231
return Str::title (str_replace ('_ ' , ' ' , $ this ->name ));
236
232
}
237
233
238
- public function variables ()
234
+ public function variables (): array
239
235
{
240
236
return [
241
237
'fieldName ' => $ this ->name ,
0 commit comments