From fb220e82ed2e1c94f8e0131e54c023a6bce62d74 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Tue, 27 Apr 2021 21:23:00 +0000 Subject: [PATCH] [TOOLS] Use \DateTimeInterface rather than DateTimeInterface --- bin/generate_entity_fields | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/generate_entity_fields b/bin/generate_entity_fields index 511234d3e2..f327f31392 100755 --- a/bin/generate_entity_fields +++ b/bin/generate_entity_fields @@ -11,8 +11,8 @@ const types = [ 'blob' => '', 'bool' => 'bool', 'char' => 'string', - 'datetime' => 'DateTimeInterface', - 'timestamp' => 'DateTimeInterface', + 'datetime' => '\DateTimeInterface', + 'timestamp' => '\DateTimeInterface', 'html' => 'string', 'int' => 'int', 'numeric' => 'float', @@ -53,7 +53,7 @@ foreach ($files as $file) { $method_name = str_replace([' ', 'Gsactor'], ['', 'GSActor'], 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') {