[TOOLS] Fix bin/generate_entity_fields

This commit is contained in:
Hugo Sales 2020-08-13 01:23:55 +00:00 committed by Hugo Sales
parent 8716d700a6
commit 636f564672
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -1,5 +1,4 @@
#!/usr/local/bin/php
<?php
use Symfony\Component\Yaml\Yaml;
@ -55,7 +54,7 @@ foreach ($files as $file) {
$method_name = str_replace(' ', '', ucwords(str_replace('_', ' ', $field)));
$default = @$schema['fields'][$field]['default'];
if (isset($default) && $nullable != '?' && $type != '\DateTimeInterface') {
if (isset($default) && $nullable != '?' && $type != 'DateTimeInterface') {
if (is_string($default)) {
$default = "'{$default}'";
} elseif ($type == 'bool') {