From 3839fa70a1adb57a76b97aea956f2160d3071076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20Perr=C3=A9al?= <guillaume.perreal@inrae.fr> Date: Mon, 6 Apr 2020 12:39:59 +0200 Subject: [PATCH] Ajoute 'object' aux builtin types. --- src/php/ModelGenerator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/php/ModelGenerator.php b/src/php/ModelGenerator.php index 94ed39e..f42035f 100644 --- a/src/php/ModelGenerator.php +++ b/src/php/ModelGenerator.php @@ -23,7 +23,6 @@ namespace Irstea\NgModelGeneratorBundle; use ApiPlatform\Core\Documentation\Documentation; use Irstea\NgModelGeneratorBundle\Exceptions\DomainException; -use Irstea\NgModelGeneratorBundle\Exceptions\Exception; use Irstea\NgModelGeneratorBundle\Iterators\IteratorBuilder; use Irstea\NgModelGeneratorBundle\Metadata\MetadataFactoryInterface; use Irstea\NgModelGeneratorBundle\Metadata\ResourceMetadata; @@ -182,7 +181,7 @@ final class ModelGenerator { $factory = new TypeFactory(); - foreach (['Array', 'Date', 'boolean', 'number', 'null', 'string', 'any', 'never', 'unknown'] as $builtin) { + foreach (['Array', 'Date', 'boolean', 'number', 'null', 'string', 'object', 'any', 'never', 'unknown'] as $builtin) { $factory->add($builtin, BuiltinType::get($builtin)); } @@ -193,6 +192,7 @@ final class ModelGenerator foreach ([ PHPType::BUILTIN_TYPE_ARRAY => 'Array', PHPType::BUILTIN_TYPE_BOOL => 'boolean', + PHPType::BUILTIN_TYPE_OBJECT => 'object', PHPType::BUILTIN_TYPE_FLOAT => 'number', PHPType::BUILTIN_TYPE_INT => 'number', PHPType::BUILTIN_TYPE_NULL => 'null', -- GitLab