add support for boolean default
Signed-off-by: Maxence Lange <maxence@artificial-owl.com> code cleaning Signed-off-by: Maxence Lange <maxence@artificial-owl.com> code cleaning Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
parent
38a49cb8af
commit
e003a77a37
|
@ -127,7 +127,11 @@ EOT
|
||||||
}
|
}
|
||||||
$default = $column->getDefault();
|
$default = $column->getDefault();
|
||||||
if ($default !== null) {
|
if ($default !== null) {
|
||||||
$default = is_numeric($default) ? $default : "'$default'";
|
if (is_string($default)) {
|
||||||
|
$default = "'$default'";
|
||||||
|
} else if (is_bool($default)) {
|
||||||
|
$default = ($default === true) ? 'true' : 'false';
|
||||||
|
}
|
||||||
$content .= str_replace('{{default}}', $default, <<<'EOT'
|
$content .= str_replace('{{default}}', $default, <<<'EOT'
|
||||||
'default' => {{default}},
|
'default' => {{default}},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue