forked from GNUsocial/gnu-social
[TOOLS] Fix bin/generate_entity_fields
This commit is contained in:
parent
0508886fc4
commit
a60c79c35d
@ -1,5 +1,4 @@
|
|||||||
#!/usr/local/bin/php
|
#!/usr/local/bin/php
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Symfony\Component\Yaml\Yaml;
|
use Symfony\Component\Yaml\Yaml;
|
||||||
@ -55,7 +54,7 @@ foreach ($files as $file) {
|
|||||||
$method_name = str_replace(' ', '', ucwords(str_replace('_', ' ', $field)));
|
$method_name = str_replace(' ', '', ucwords(str_replace('_', ' ', $field)));
|
||||||
$default = @$schema['fields'][$field]['default'];
|
$default = @$schema['fields'][$field]['default'];
|
||||||
|
|
||||||
if (isset($default) && $nullable != '?' && $type != '\DateTimeInterface') {
|
if (isset($default) && $nullable != '?' && $type != 'DateTimeInterface') {
|
||||||
if (is_string($default)) {
|
if (is_string($default)) {
|
||||||
$default = "'{$default}'";
|
$default = "'{$default}'";
|
||||||
} elseif ($type == 'bool') {
|
} elseif ($type == 'bool') {
|
||||||
|
Loading…
Reference in New Issue
Block a user