From 9a4ce18558ca805b9e4ffd34e0e1edaf11ee5b57 Mon Sep 17 00:00:00 2001 From: Perreal Guillaume <guillaume.perreal@irstea.fr> Date: Fri, 22 Mar 2019 17:19:39 +0100 Subject: [PATCH] CS. --- src/php/Command/NgModelGenerateCommand.php | 2 +- src/php/Command/NgModelMetadataCommand.php | 2 +- .../NgModelGeneratorExtension.php | 2 +- src/php/Exceptions/BadMethodCallException.php | 2 +- src/php/Exceptions/DomainException.php | 2 +- src/php/Exceptions/Exception.php | 2 +- src/php/Exceptions/InvalidArgumentException.php | 2 +- src/php/Exceptions/TypeAlreadyExistsException.php | 2 +- src/php/Exceptions/TypeError.php | 2 +- src/php/Exceptions/TypeNotFoundException.php | 2 +- .../Iterators/CallbackFilterRecursorIterator.php | 2 +- src/php/Iterators/IteratorBuilder.php | 2 +- src/php/Iterators/RecursiveUniqueIterator.php | 2 +- src/php/Iterators/RecursorIterator.php | 2 +- src/php/Iterators/UniqueFilter.php | 2 +- src/php/Iterators/UniqueIterator.php | 2 +- src/php/Iterators/UniqueIteratorTrait.php | 2 +- src/php/Metadata/CachingMetadataFactory.php | 2 +- src/php/Metadata/ClassHierarchy.php | 2 +- src/php/Metadata/MetadataFactory.php | 3 +-- src/php/Metadata/MetadataFactoryInterface.php | 2 +- src/php/Metadata/OperationDef.php | 2 +- src/php/Metadata/OperationMetadata.php | 6 +++--- src/php/Metadata/PaginationMetadata.php | 2 +- src/php/Metadata/PropertyMetadata.php | 4 ++-- src/php/Metadata/PropertyMetadataFactory.php | 2 +- src/php/Metadata/RepresentationMetadata.php | 6 +++--- src/php/Metadata/ResourceClassHierarchy.php | 2 +- src/php/Metadata/ResourceMetadata.php | 2 +- src/php/Metadata/SerializationMetadata.php | 2 +- src/php/ModelGenerator.php | 9 ++++----- src/php/Models/ClassInfo.php | 4 ++-- src/php/Models/ClassName.php | 2 +- src/php/Models/Declaration.php | 2 +- src/php/Models/DeclarationTrait.php | 2 +- src/php/Models/HasName.php | 2 +- src/php/Models/MultitonTrait.php | 2 +- src/php/Models/NamedTrait.php | 2 +- src/php/Models/PHPClass.php | 2 +- src/php/Models/Types/AbstractCollection.php | 2 +- src/php/Models/Types/AbstractType.php | 2 +- src/php/Models/Types/Alias.php | 4 ++-- src/php/Models/Types/ArrayType.php | 12 +++++++----- src/php/Models/Types/BuiltinType.php | 2 +- src/php/Models/Types/Deferred.php | 2 +- .../Types/Objects/AbstractHierarchicalObject.php | 2 +- src/php/Models/Types/Objects/AnonymousObject.php | 2 +- src/php/Models/Types/Objects/ClassType.php | 2 +- src/php/Models/Types/Objects/InterfaceType.php | 2 +- src/php/Models/Types/Objects/Property.php | 2 +- src/php/Models/Types/Objects/Repository.php | 2 +- src/php/Models/Types/Operations/FixedPathPart.php | 2 +- src/php/Models/Types/Operations/Operation.php | 2 +- src/php/Models/Types/Operations/Parameter.php | 2 +- .../Models/Types/Operations/ParameterPathPart.php | 2 +- src/php/Models/Types/Operations/Path.php | 2 +- src/php/Models/Types/Operations/PathPart.php | 2 +- src/php/Models/Types/Placeholder.php | 2 +- src/php/Models/Types/Reference.php | 2 +- src/php/Models/Types/Resources/Collection.php | 2 +- src/php/Models/Types/Resources/IRI.php | 2 +- src/php/Models/Types/Resources/Representation.php | 2 +- src/php/Models/Types/Resources/UUID.php | 2 +- src/php/Models/Types/StringConst.php | 2 +- src/php/Models/Types/Type.php | 2 +- src/php/Models/Types/Union.php | 2 +- src/php/Models/Types/Unresolved.php | 2 +- src/php/NgModelGeneratorBundle.php | 2 +- src/php/OperationMapper.php | 15 +++++++-------- src/php/PathParser.php | 2 +- src/php/PathParserInterface.php | 2 +- src/php/SerializationMapper.php | 2 +- src/php/SerializationMapperFactory.php | 2 +- src/php/SerializationMapperFactoryInterface.php | 2 +- src/php/Twig/GeneratorExtension.php | 2 +- src/php/TypeFactory.php | 2 +- src/php/TypeFactoryInterface.php | 2 +- src/php/TypescriptHelper.php | 2 +- src/php/Writers/ConsoleWriter.php | 2 +- src/php/Writers/DirectoryWriter.php | 2 +- src/php/Writers/FilteringFileWriter.php | 2 +- src/php/Writers/MultiFileWriter.php | 2 +- src/php/Writers/NullWriter.php | 2 +- src/php/Writers/PhonyFileWriter.php | 2 +- src/php/Writers/StreamWriter.php | 2 +- src/php/Writers/Writer.php | 2 +- src/php/Writers/ZipFileWriter.php | 2 +- src/php/Writers/ZipWriter.php | 2 +- 88 files changed, 110 insertions(+), 111 deletions(-) diff --git a/src/php/Command/NgModelGenerateCommand.php b/src/php/Command/NgModelGenerateCommand.php index 9f67c78..ffe83af 100644 --- a/src/php/Command/NgModelGenerateCommand.php +++ b/src/php/Command/NgModelGenerateCommand.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Command/NgModelMetadataCommand.php b/src/php/Command/NgModelMetadataCommand.php index c2d85e9..56dd8de 100644 --- a/src/php/Command/NgModelMetadataCommand.php +++ b/src/php/Command/NgModelMetadataCommand.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/DependencyInjection/NgModelGeneratorExtension.php b/src/php/DependencyInjection/NgModelGeneratorExtension.php index 477d807..f6b041c 100644 --- a/src/php/DependencyInjection/NgModelGeneratorExtension.php +++ b/src/php/DependencyInjection/NgModelGeneratorExtension.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Exceptions/BadMethodCallException.php b/src/php/Exceptions/BadMethodCallException.php index 6020420..bbfd870 100644 --- a/src/php/Exceptions/BadMethodCallException.php +++ b/src/php/Exceptions/BadMethodCallException.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Exceptions/DomainException.php b/src/php/Exceptions/DomainException.php index b7111e7..87571d8 100644 --- a/src/php/Exceptions/DomainException.php +++ b/src/php/Exceptions/DomainException.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Exceptions/Exception.php b/src/php/Exceptions/Exception.php index 3675429..231d488 100644 --- a/src/php/Exceptions/Exception.php +++ b/src/php/Exceptions/Exception.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Exceptions/InvalidArgumentException.php b/src/php/Exceptions/InvalidArgumentException.php index e2113ac..4d0f2d4 100644 --- a/src/php/Exceptions/InvalidArgumentException.php +++ b/src/php/Exceptions/InvalidArgumentException.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Exceptions/TypeAlreadyExistsException.php b/src/php/Exceptions/TypeAlreadyExistsException.php index b235a93..61e7655 100644 --- a/src/php/Exceptions/TypeAlreadyExistsException.php +++ b/src/php/Exceptions/TypeAlreadyExistsException.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Exceptions/TypeError.php b/src/php/Exceptions/TypeError.php index 2b4c4b2..326c794 100644 --- a/src/php/Exceptions/TypeError.php +++ b/src/php/Exceptions/TypeError.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Exceptions/TypeNotFoundException.php b/src/php/Exceptions/TypeNotFoundException.php index 59a01d6..2c5d80a 100644 --- a/src/php/Exceptions/TypeNotFoundException.php +++ b/src/php/Exceptions/TypeNotFoundException.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Iterators/CallbackFilterRecursorIterator.php b/src/php/Iterators/CallbackFilterRecursorIterator.php index 1dfdb60..8a7b28f 100644 --- a/src/php/Iterators/CallbackFilterRecursorIterator.php +++ b/src/php/Iterators/CallbackFilterRecursorIterator.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Iterators/IteratorBuilder.php b/src/php/Iterators/IteratorBuilder.php index 907f73e..b808c17 100644 --- a/src/php/Iterators/IteratorBuilder.php +++ b/src/php/Iterators/IteratorBuilder.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Iterators/RecursiveUniqueIterator.php b/src/php/Iterators/RecursiveUniqueIterator.php index ddbf15d..4513311 100644 --- a/src/php/Iterators/RecursiveUniqueIterator.php +++ b/src/php/Iterators/RecursiveUniqueIterator.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Iterators/RecursorIterator.php b/src/php/Iterators/RecursorIterator.php index 56323ea..f1cab08 100644 --- a/src/php/Iterators/RecursorIterator.php +++ b/src/php/Iterators/RecursorIterator.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Iterators/UniqueFilter.php b/src/php/Iterators/UniqueFilter.php index 37f5848..29bd398 100644 --- a/src/php/Iterators/UniqueFilter.php +++ b/src/php/Iterators/UniqueFilter.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Iterators/UniqueIterator.php b/src/php/Iterators/UniqueIterator.php index 47c4ae9..9eb65d6 100644 --- a/src/php/Iterators/UniqueIterator.php +++ b/src/php/Iterators/UniqueIterator.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Iterators/UniqueIteratorTrait.php b/src/php/Iterators/UniqueIteratorTrait.php index 7d67db1..4acaeba 100644 --- a/src/php/Iterators/UniqueIteratorTrait.php +++ b/src/php/Iterators/UniqueIteratorTrait.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Metadata/CachingMetadataFactory.php b/src/php/Metadata/CachingMetadataFactory.php index 49213bb..a01aa7d 100644 --- a/src/php/Metadata/CachingMetadataFactory.php +++ b/src/php/Metadata/CachingMetadataFactory.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Metadata/ClassHierarchy.php b/src/php/Metadata/ClassHierarchy.php index e04102b..5d93f34 100644 --- a/src/php/Metadata/ClassHierarchy.php +++ b/src/php/Metadata/ClassHierarchy.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Metadata/MetadataFactory.php b/src/php/Metadata/MetadataFactory.php index 2ca82fa..2c6ba1f 100644 --- a/src/php/Metadata/MetadataFactory.php +++ b/src/php/Metadata/MetadataFactory.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free @@ -296,7 +296,6 @@ final class MetadataFactory implements MetadataFactoryInterface continue; } - $filters[] = $this->filterLocator->get($filterId); } diff --git a/src/php/Metadata/MetadataFactoryInterface.php b/src/php/Metadata/MetadataFactoryInterface.php index 0689ea5..c2f971e 100644 --- a/src/php/Metadata/MetadataFactoryInterface.php +++ b/src/php/Metadata/MetadataFactoryInterface.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Metadata/OperationDef.php b/src/php/Metadata/OperationDef.php index a4427f0..b948ee7 100644 --- a/src/php/Metadata/OperationDef.php +++ b/src/php/Metadata/OperationDef.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Metadata/OperationMetadata.php b/src/php/Metadata/OperationMetadata.php index 63109c8..c3dae07 100644 --- a/src/php/Metadata/OperationMetadata.php +++ b/src/php/Metadata/OperationMetadata.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free @@ -253,8 +253,8 @@ class OperationMetadata implements \JsonSerializable, HasName public function jsonSerialize() { $vars = array_merge( - $this->opDef->jsonSerialize(), - \get_object_vars($this) + $this->opDef->jsonSerialize(), + \get_object_vars($this) ); unset($vars['resource'], $vars['opDef']); diff --git a/src/php/Metadata/PaginationMetadata.php b/src/php/Metadata/PaginationMetadata.php index ec728d1..8931bec 100644 --- a/src/php/Metadata/PaginationMetadata.php +++ b/src/php/Metadata/PaginationMetadata.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Metadata/PropertyMetadata.php b/src/php/Metadata/PropertyMetadata.php index ef8c72d..83b7b49 100644 --- a/src/php/Metadata/PropertyMetadata.php +++ b/src/php/Metadata/PropertyMetadata.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free @@ -220,7 +220,7 @@ class PropertyMetadata implements \JsonSerializable, HasName } /** - * @param null|Type $type + * @param Type|null $type * * @return array|null */ diff --git a/src/php/Metadata/PropertyMetadataFactory.php b/src/php/Metadata/PropertyMetadataFactory.php index 1747572..76fd3dd 100644 --- a/src/php/Metadata/PropertyMetadataFactory.php +++ b/src/php/Metadata/PropertyMetadataFactory.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Metadata/RepresentationMetadata.php b/src/php/Metadata/RepresentationMetadata.php index a020c3e..e202153 100644 --- a/src/php/Metadata/RepresentationMetadata.php +++ b/src/php/Metadata/RepresentationMetadata.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free @@ -41,7 +41,7 @@ final class RepresentationMetadata implements ClassName, HasName private $class; /** - * @var null|ClassName + * @var ClassName|null */ private $parent; @@ -126,7 +126,7 @@ final class RepresentationMetadata implements ClassName, HasName /** * Get parent. * - * @return null|ClassName + * @return ClassName|null */ public function getParent(): ?ClassName { diff --git a/src/php/Metadata/ResourceClassHierarchy.php b/src/php/Metadata/ResourceClassHierarchy.php index bbf2f9e..6d6be8b 100644 --- a/src/php/Metadata/ResourceClassHierarchy.php +++ b/src/php/Metadata/ResourceClassHierarchy.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Metadata/ResourceMetadata.php b/src/php/Metadata/ResourceMetadata.php index 98c088f..37e1105 100644 --- a/src/php/Metadata/ResourceMetadata.php +++ b/src/php/Metadata/ResourceMetadata.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Metadata/SerializationMetadata.php b/src/php/Metadata/SerializationMetadata.php index 5f5710b..15fb5c5 100644 --- a/src/php/Metadata/SerializationMetadata.php +++ b/src/php/Metadata/SerializationMetadata.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/ModelGenerator.php b/src/php/ModelGenerator.php index 9b5980a..f87e44d 100644 --- a/src/php/ModelGenerator.php +++ b/src/php/ModelGenerator.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free @@ -201,7 +201,7 @@ final class ModelGenerator $factory->add('UUID', UUID::get()); $factory->add('CommonFilters', $this->createCommonFilters('CommonFilters')); - $factory->add('Ordering', $this->createOrdering()); + $factory->add('Ordering', $this->createOrdering()); foreach ([ PHPType::BUILTIN_TYPE_ARRAY => 'Array', @@ -252,7 +252,6 @@ final class ModelGenerator return new Alias('Ordering', Union::create([StringConst::get('asc'), StringConst::get('desc')]), 'Allowed values for ordering parameters'); } - /** * Retourne un iterateur sur les métadonnées des ressources. * @@ -334,8 +333,8 @@ final class ModelGenerator if (!$identifier) { printf( "No identifier found for %s (groups: [%s])\n", - $resourceMeta->getBaseName(), - implode(', ', $defaultNormalization->getGroups()) + $resourceMeta->getBaseName(), + implode(', ', $defaultNormalization->getGroups()) ); return null; diff --git a/src/php/Models/ClassInfo.php b/src/php/Models/ClassInfo.php index 335c5ca..cb303e4 100644 --- a/src/php/Models/ClassInfo.php +++ b/src/php/Models/ClassInfo.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free @@ -36,7 +36,7 @@ final class ClassInfo implements ClassName /** @var ClassName */ private $class; - /** @var self|null|false */ + /** @var self|false|null */ private $parent = false; /** @var HasName[] */ diff --git a/src/php/Models/ClassName.php b/src/php/Models/ClassName.php index 64b219c..256b2f0 100644 --- a/src/php/Models/ClassName.php +++ b/src/php/Models/ClassName.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Declaration.php b/src/php/Models/Declaration.php index 7624c81..990b925 100644 --- a/src/php/Models/Declaration.php +++ b/src/php/Models/Declaration.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/DeclarationTrait.php b/src/php/Models/DeclarationTrait.php index c38e6e7..fdaa00d 100644 --- a/src/php/Models/DeclarationTrait.php +++ b/src/php/Models/DeclarationTrait.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/HasName.php b/src/php/Models/HasName.php index d8425c4..8d243e4 100644 --- a/src/php/Models/HasName.php +++ b/src/php/Models/HasName.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/MultitonTrait.php b/src/php/Models/MultitonTrait.php index a620f88..1bea689 100644 --- a/src/php/Models/MultitonTrait.php +++ b/src/php/Models/MultitonTrait.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/NamedTrait.php b/src/php/Models/NamedTrait.php index 398234b..730fa75 100644 --- a/src/php/Models/NamedTrait.php +++ b/src/php/Models/NamedTrait.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/PHPClass.php b/src/php/Models/PHPClass.php index 73babc0..ab84008 100644 --- a/src/php/Models/PHPClass.php +++ b/src/php/Models/PHPClass.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/AbstractCollection.php b/src/php/Models/Types/AbstractCollection.php index 3e8f6a8..eb6994a 100644 --- a/src/php/Models/Types/AbstractCollection.php +++ b/src/php/Models/Types/AbstractCollection.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/AbstractType.php b/src/php/Models/Types/AbstractType.php index 0cc6659..018cb90 100644 --- a/src/php/Models/Types/AbstractType.php +++ b/src/php/Models/Types/AbstractType.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Alias.php b/src/php/Models/Types/Alias.php index 9447768..8a6936a 100644 --- a/src/php/Models/Types/Alias.php +++ b/src/php/Models/Types/Alias.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free @@ -56,7 +56,7 @@ final class Alias extends AbstractType implements Declaration { return sprintf( '%sexport type %s = %s;', - $this->description + $this->description ? sprintf("/**\n%s\n */\n", TypescriptHelper::indent($this->description, ' * ')) : '', $this->name, diff --git a/src/php/Models/Types/ArrayType.php b/src/php/Models/Types/ArrayType.php index 235bb87..ff9b542 100644 --- a/src/php/Models/Types/ArrayType.php +++ b/src/php/Models/Types/ArrayType.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free @@ -50,9 +50,9 @@ class ArrayType extends AbstractCollection public function castToStringOrStringArray(string $expr): string { $itemName = $this->getItemName(); - $cast = $this->valueType->castToStringOrStringArray( $itemName); - if ($cast !== $itemName) { - return sprintf('%s.map(%s => %s)', $expr, $itemName, $cast); + $cast = $this->valueType->castToStringOrStringArray($itemName); + if ($cast !== $itemName) { + return sprintf('%s.map(%s => %s)', $expr, $itemName, $cast); } return $expr; @@ -64,6 +64,7 @@ class ArrayType extends AbstractCollection public function checkType(string $expr, bool $explicit = false): string { $itemName = $this->getItemName(); + return sprintf( '(Array.isArray(%s) && %s.every(%s => %s))', $expr, @@ -80,6 +81,7 @@ class ArrayType extends AbstractCollection { $valueUsage = $this->getValueType()->getUsage(); $valueName = strtr($valueUsage, '[]<>', '[]__'); - return Inflector::singularize(Inflector::camelize( $valueName)); + + return Inflector::singularize(Inflector::camelize($valueName)); } } diff --git a/src/php/Models/Types/BuiltinType.php b/src/php/Models/Types/BuiltinType.php index 832606a..d468163 100644 --- a/src/php/Models/Types/BuiltinType.php +++ b/src/php/Models/Types/BuiltinType.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Deferred.php b/src/php/Models/Types/Deferred.php index 5848e5c..dd4e722 100644 --- a/src/php/Models/Types/Deferred.php +++ b/src/php/Models/Types/Deferred.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Objects/AbstractHierarchicalObject.php b/src/php/Models/Types/Objects/AbstractHierarchicalObject.php index 0826091..15b26b1 100644 --- a/src/php/Models/Types/Objects/AbstractHierarchicalObject.php +++ b/src/php/Models/Types/Objects/AbstractHierarchicalObject.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Objects/AnonymousObject.php b/src/php/Models/Types/Objects/AnonymousObject.php index 58333e0..ffd2b6c 100644 --- a/src/php/Models/Types/Objects/AnonymousObject.php +++ b/src/php/Models/Types/Objects/AnonymousObject.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Objects/ClassType.php b/src/php/Models/Types/Objects/ClassType.php index d6763cc..7115445 100644 --- a/src/php/Models/Types/Objects/ClassType.php +++ b/src/php/Models/Types/Objects/ClassType.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Objects/InterfaceType.php b/src/php/Models/Types/Objects/InterfaceType.php index 09a6a6b..0dcfb4a 100644 --- a/src/php/Models/Types/Objects/InterfaceType.php +++ b/src/php/Models/Types/Objects/InterfaceType.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Objects/Property.php b/src/php/Models/Types/Objects/Property.php index ff665bd..07ad520 100644 --- a/src/php/Models/Types/Objects/Property.php +++ b/src/php/Models/Types/Objects/Property.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Objects/Repository.php b/src/php/Models/Types/Objects/Repository.php index 602e31d..cc6e36a 100644 --- a/src/php/Models/Types/Objects/Repository.php +++ b/src/php/Models/Types/Objects/Repository.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Operations/FixedPathPart.php b/src/php/Models/Types/Operations/FixedPathPart.php index 5379ebb..527cb19 100644 --- a/src/php/Models/Types/Operations/FixedPathPart.php +++ b/src/php/Models/Types/Operations/FixedPathPart.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Operations/Operation.php b/src/php/Models/Types/Operations/Operation.php index 907fee5..39e01aa 100644 --- a/src/php/Models/Types/Operations/Operation.php +++ b/src/php/Models/Types/Operations/Operation.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Operations/Parameter.php b/src/php/Models/Types/Operations/Parameter.php index 974abbf..fdd2c2b 100644 --- a/src/php/Models/Types/Operations/Parameter.php +++ b/src/php/Models/Types/Operations/Parameter.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Operations/ParameterPathPart.php b/src/php/Models/Types/Operations/ParameterPathPart.php index f490aff..fe530f6 100644 --- a/src/php/Models/Types/Operations/ParameterPathPart.php +++ b/src/php/Models/Types/Operations/ParameterPathPart.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Operations/Path.php b/src/php/Models/Types/Operations/Path.php index c612140..4b126a3 100644 --- a/src/php/Models/Types/Operations/Path.php +++ b/src/php/Models/Types/Operations/Path.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Operations/PathPart.php b/src/php/Models/Types/Operations/PathPart.php index cd0b24b..1729eaa 100644 --- a/src/php/Models/Types/Operations/PathPart.php +++ b/src/php/Models/Types/Operations/PathPart.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Placeholder.php b/src/php/Models/Types/Placeholder.php index 137276b..97e3270 100644 --- a/src/php/Models/Types/Placeholder.php +++ b/src/php/Models/Types/Placeholder.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Reference.php b/src/php/Models/Types/Reference.php index 855bf64..78ed019 100644 --- a/src/php/Models/Types/Reference.php +++ b/src/php/Models/Types/Reference.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Resources/Collection.php b/src/php/Models/Types/Resources/Collection.php index 7666b52..7b52f73 100644 --- a/src/php/Models/Types/Resources/Collection.php +++ b/src/php/Models/Types/Resources/Collection.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Resources/IRI.php b/src/php/Models/Types/Resources/IRI.php index 4996dc9..4b3fa4b 100644 --- a/src/php/Models/Types/Resources/IRI.php +++ b/src/php/Models/Types/Resources/IRI.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Resources/Representation.php b/src/php/Models/Types/Resources/Representation.php index a7904ca..f712702 100644 --- a/src/php/Models/Types/Resources/Representation.php +++ b/src/php/Models/Types/Resources/Representation.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Resources/UUID.php b/src/php/Models/Types/Resources/UUID.php index 7159bcd..dde4c0e 100644 --- a/src/php/Models/Types/Resources/UUID.php +++ b/src/php/Models/Types/Resources/UUID.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/StringConst.php b/src/php/Models/Types/StringConst.php index 2ac39c4..feaf6a2 100644 --- a/src/php/Models/Types/StringConst.php +++ b/src/php/Models/Types/StringConst.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Type.php b/src/php/Models/Types/Type.php index 23289c9..f9ef6f5 100644 --- a/src/php/Models/Types/Type.php +++ b/src/php/Models/Types/Type.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Union.php b/src/php/Models/Types/Union.php index fc863fa..c488e9f 100644 --- a/src/php/Models/Types/Union.php +++ b/src/php/Models/Types/Union.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Models/Types/Unresolved.php b/src/php/Models/Types/Unresolved.php index 5d5ab82..f005602 100644 --- a/src/php/Models/Types/Unresolved.php +++ b/src/php/Models/Types/Unresolved.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/NgModelGeneratorBundle.php b/src/php/NgModelGeneratorBundle.php index 88679a4..f67d47c 100644 --- a/src/php/NgModelGeneratorBundle.php +++ b/src/php/NgModelGeneratorBundle.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/OperationMapper.php b/src/php/OperationMapper.php index d820618..247a792 100644 --- a/src/php/OperationMapper.php +++ b/src/php/OperationMapper.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free @@ -39,8 +39,6 @@ use Irstea\NgModelGeneratorBundle\Models\Types\Placeholder; use Irstea\NgModelGeneratorBundle\Models\Types\Reference; use Irstea\NgModelGeneratorBundle\Models\Types\Resources\Collection; use Irstea\NgModelGeneratorBundle\Models\Types\Resources\IRI; -use Irstea\NgModelGeneratorBundle\Models\Types\Resources\Representation; -use Irstea\NgModelGeneratorBundle\Models\Types\StringConst; use Irstea\NgModelGeneratorBundle\Models\Types\Type; use Irstea\NgModelGeneratorBundle\Models\Types\Union; @@ -247,11 +245,9 @@ final class OperationMapper $rootClass = $this->operation->getClassName(); foreach ($this->operation->getFilters() as $filter) { - - $filterType = PHPClass::get(get_class($filter))->getBaseName(); + $filterType = PHPClass::get(get_class($filter))->getBaseName(); foreach ($filter->getDescription($this->operation->getResource()->getFullName()) as $name => $filterDesc) { - $type = $this->typeFactory->get($filterDesc['type']); if (isset($filterDesc['property']) && is_string($filterDesc['property'])) { @@ -267,7 +263,7 @@ final class OperationMapper $type = $this->getSingularType($type); $propName = Inflector::singularize($propName); - if (!empty($filterDesc['is_collection']) || substr($name, strlen($name)-2) === '[]') { + if (!empty($filterDesc['is_collection']) || substr($name, strlen($name) - 2) === '[]') { $type = new ArrayType($type); $propName .= 'In'; } @@ -335,6 +331,7 @@ final class OperationMapper case 'ExistFilter': return BuiltinType::get('boolean'); } + return $baseType; } @@ -343,13 +340,15 @@ final class OperationMapper * * @return Type */ - private function getSingularType(Type $type): Type { + private function getSingularType(Type $type): Type + { if ($type instanceof AbstractCollection) { return $type->getValueType(); } if ($type instanceof Reference) { return $this->getSingularType($type->getTarget()); } + return $type; } diff --git a/src/php/PathParser.php b/src/php/PathParser.php index 9855a94..653daa2 100644 --- a/src/php/PathParser.php +++ b/src/php/PathParser.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/PathParserInterface.php b/src/php/PathParserInterface.php index f35003b..5d993c2 100644 --- a/src/php/PathParserInterface.php +++ b/src/php/PathParserInterface.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/SerializationMapper.php b/src/php/SerializationMapper.php index 2a2070a..bce64a1 100644 --- a/src/php/SerializationMapper.php +++ b/src/php/SerializationMapper.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/SerializationMapperFactory.php b/src/php/SerializationMapperFactory.php index f23fb65..58e0be3 100644 --- a/src/php/SerializationMapperFactory.php +++ b/src/php/SerializationMapperFactory.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/SerializationMapperFactoryInterface.php b/src/php/SerializationMapperFactoryInterface.php index f90a15a..3b8362c 100644 --- a/src/php/SerializationMapperFactoryInterface.php +++ b/src/php/SerializationMapperFactoryInterface.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Twig/GeneratorExtension.php b/src/php/Twig/GeneratorExtension.php index 6b95abf..68bd293 100644 --- a/src/php/Twig/GeneratorExtension.php +++ b/src/php/Twig/GeneratorExtension.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/TypeFactory.php b/src/php/TypeFactory.php index 33655da..a9422d8 100644 --- a/src/php/TypeFactory.php +++ b/src/php/TypeFactory.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/TypeFactoryInterface.php b/src/php/TypeFactoryInterface.php index 5bdc88f..bfd1641 100644 --- a/src/php/TypeFactoryInterface.php +++ b/src/php/TypeFactoryInterface.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/TypescriptHelper.php b/src/php/TypescriptHelper.php index 5527502..ff7cead 100644 --- a/src/php/TypescriptHelper.php +++ b/src/php/TypescriptHelper.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Writers/ConsoleWriter.php b/src/php/Writers/ConsoleWriter.php index 297913c..35d6eb5 100644 --- a/src/php/Writers/ConsoleWriter.php +++ b/src/php/Writers/ConsoleWriter.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Writers/DirectoryWriter.php b/src/php/Writers/DirectoryWriter.php index 5de69c0..e11a674 100644 --- a/src/php/Writers/DirectoryWriter.php +++ b/src/php/Writers/DirectoryWriter.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Writers/FilteringFileWriter.php b/src/php/Writers/FilteringFileWriter.php index 08633ac..94364aa 100644 --- a/src/php/Writers/FilteringFileWriter.php +++ b/src/php/Writers/FilteringFileWriter.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Writers/MultiFileWriter.php b/src/php/Writers/MultiFileWriter.php index cf0a479..16a9660 100644 --- a/src/php/Writers/MultiFileWriter.php +++ b/src/php/Writers/MultiFileWriter.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Writers/NullWriter.php b/src/php/Writers/NullWriter.php index 127ed4f..167ec8a 100644 --- a/src/php/Writers/NullWriter.php +++ b/src/php/Writers/NullWriter.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Writers/PhonyFileWriter.php b/src/php/Writers/PhonyFileWriter.php index 696bad1..21f5ce5 100644 --- a/src/php/Writers/PhonyFileWriter.php +++ b/src/php/Writers/PhonyFileWriter.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Writers/StreamWriter.php b/src/php/Writers/StreamWriter.php index f91dd19..08cbbbd 100644 --- a/src/php/Writers/StreamWriter.php +++ b/src/php/Writers/StreamWriter.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Writers/Writer.php b/src/php/Writers/Writer.php index 78695c0..8656455 100644 --- a/src/php/Writers/Writer.php +++ b/src/php/Writers/Writer.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Writers/ZipFileWriter.php b/src/php/Writers/ZipFileWriter.php index 0216b76..7cec0de 100644 --- a/src/php/Writers/ZipFileWriter.php +++ b/src/php/Writers/ZipFileWriter.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free diff --git a/src/php/Writers/ZipWriter.php b/src/php/Writers/ZipWriter.php index f482873..9f3e917 100644 --- a/src/php/Writers/ZipWriter.php +++ b/src/php/Writers/ZipWriter.php @@ -3,7 +3,7 @@ * This file is part of "irstea/ng-model-generator-bundle". * * "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata. - * Copyright (C) 2018 IRSTEA + * Copyright (C) 2018-2019 IRSTEA * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free -- GitLab