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:
Maxence Lange 2019-01-09 08:51:31 -01:00 committed by Backportbot
parent 38a49cb8af
commit e003a77a37
1 changed files with 5 additions and 1 deletions

View File

@ -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}},