@@ -25,7 +25,7 @@ protected function generateField(FieldEntity $fieldEntity): string
2525 $ argumentString = $ this ->renderArguments ($ fieldEntity ->getArguments ());
2626
2727 $ methods = [
28- $ fieldEntity ->getType () . "(' " . $ fieldEntity ->getColumnName () . "' " . $ argumentString . ") " ,
28+ $ fieldEntity ->getType (). "(' " . $ fieldEntity ->getColumnName (). "' " . $ argumentString. ") " ,
2929 ...$ this ->getFluentOptions ($ fieldEntity ->getOptions ()),
3030 ];
3131
@@ -37,20 +37,18 @@ private function renderArguments(array $arguments): string
3737 $ args = [];
3838
3939 foreach ($ arguments as $ arg ) {
40- if ($ arg === null ) {
41- continue ;
42- }
43-
44- if (is_bool ($ arg )) {
45- $ args [] = $ arg ? 'true ' : 'false ' ;
46- } elseif (is_int ($ arg )) {
47- $ args [] = $ arg ;
48- } else {
49- $ args [] = "' " . $ arg . "' " ;
40+ if (null !== $ arg ) {
41+ if (is_bool ($ arg )) {
42+ $ args [] = $ arg ? 'true ' : 'false ' ;
43+ } elseif (is_int ($ arg )) {
44+ $ args [] = $ arg ;
45+ } else {
46+ $ args [] = "' " .$ arg ."' " ;
47+ }
5048 }
5149 }
5250
53- return count ($ args ) > 0 ? ', ' . implode (', ' , $ args ) : '' ;
51+ return count ($ args ) > 0 ? ', ' . implode (', ' , $ args ) : '' ;
5452 }
5553
5654 private function getFluentOptions (array $ options ): array
@@ -60,7 +58,7 @@ private function getFluentOptions(array $options): array
6058 if (!empty ($ options ['default ' ])) {
6159 $ methods [] = $ options ['default ' ] === 'CURRENT_TIMESTAMP '
6260 ? "default(DB::raw('CURRENT_TIMESTAMP')) "
63- : "default(' " . $ options ['default ' ] . "') " ;
61+ : "default(' " . $ options ['default ' ]. "') " ;
6462 }
6563
6664 if (!empty ($ options ['unsigned ' ])) {
@@ -72,7 +70,7 @@ private function getFluentOptions(array $options): array
7270 }
7371
7472 if (!empty ($ options ['comment ' ])) {
75- $ methods [] = "comment(' " . addcslashes ($ options ['comment ' ], "\\' " ) . "') " ;
73+ $ methods [] = "comment(' " . addcslashes ($ options ['comment ' ], "\\' " ). "') " ;
7674 }
7775
7876 return $ methods ;
0 commit comments