Skip to content

Commit 1a31cb3

Browse files
committed
fix: minor fixes
1 parent 8f358ed commit 1a31cb3

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/Common/GeneratorField.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,14 @@ class GeneratorField
2323
public bool $inForm = true;
2424
public bool $inIndex = true;
2525
public bool $inView = true;
26+
public bool $isNotNull = false;
2627

2728
public string $migrationText = '';
2829
public string $foreignKeyText = '';
2930

30-
public bool $isNotNull = false;
31-
3231
public int $numberDecimalPoints = 2;
3332

34-
/**
35-
* @param $dbInput
36-
*/
37-
public function parseDBType($dbInput)
33+
public function parseDBType(string $dbInput)
3834
{
3935
if (!Str::contains($dbInput, ':')) {
4036
$this->dbType = $dbInput;
@@ -64,7 +60,7 @@ public function parseDBType($dbInput)
6460
$this->prepareMigrationText();
6561
}
6662

67-
public function parseHtmlInput($htmlInput)
63+
public function parseHtmlInput(string $htmlInput)
6864
{
6965
if (empty($htmlInput)) {
7066
$this->htmlType = 'text';
@@ -83,7 +79,7 @@ public function parseHtmlInput($htmlInput)
8379
$this->htmlValues = explode(',', implode(':', $htmlInputArr));
8480
}
8581

86-
public function parseOptions($options)
82+
public function parseOptions(string $options)
8783
{
8884
$options = strtolower($options);
8985
$optionsArr = explode(',', $options);
@@ -209,7 +205,7 @@ public static function parseFieldFromConsoleInput(string $fieldInput, string $va
209205
return $field;
210206
}
211207

212-
public static function parseFieldFromFile($fieldInput): self
208+
public static function parseFieldFromFile(array $fieldInput): self
213209
{
214210
$field = new self();
215211
$field->name = $fieldInput['name'];
@@ -230,12 +226,12 @@ public static function parseFieldFromFile($fieldInput): self
230226
return $field;
231227
}
232228

233-
public function getTitle()
229+
public function getTitle(): string
234230
{
235231
return Str::title(str_replace('_', ' ', $this->name));
236232
}
237233

238-
public function variables()
234+
public function variables(): array
239235
{
240236
return [
241237
'fieldName' => $this->name,

0 commit comments

Comments
 (0)