Skip to content

Commit c234cfe

Browse files
committed
data type finder updated
1 parent 166cc61 commit c234cfe

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/Commands/ShowTableColumnsForDocBlockCommand.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,20 @@ public function handle()
6868
*/
6969
private function getType($databaseType)
7070
{
71-
if (strpos($databaseType, 'timestamp') !== false) {
72-
return 'string|\Illuminate\Support\Carbon';
73-
}
71+
switch (true) {
72+
case strpos($databaseType, 'char') !== false:
73+
case strpos($databaseType, 'text') !== false:
74+
return 'string';
7475

75-
if (strpos($databaseType, 'date') !== false) {
76-
return 'string|\Illuminate\Support\Carbon';
77-
}
76+
case strpos($databaseType, 'int') !== false:
77+
return 'int';
7878

79-
if (strpos($databaseType, 'char') !== false) {
80-
return 'string';
81-
}
79+
case strpos($databaseType, 'timestamp') !== false:
80+
case strpos($databaseType, 'date') !== false:
81+
return 'string|\Illuminate\Support\Carbon';
8282

83-
if (strpos($databaseType, 'int') !== false) {
84-
return 'int';
83+
default:
84+
return $databaseType;
8585
}
86-
87-
return $databaseType;
8886
}
8987
}

0 commit comments

Comments
 (0)