diff --git a/src/php/Command/NgModelGenerateCommand.php b/src/php/Command/NgModelGenerateCommand.php index 9f67c782cc3244996155a0c8e9f916a211be43fd..ffe83afb87d241084f253a9da2df92df01a73fcc 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 c2d85e972801905ce71d4883350d55ebc3228c64..56dd8de87b09fa2e39c75b21eed77047759eafcb 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 477d80768913c571236c70bea7465562b8214a2b..f6b041c6ff9a7406afed0943cd1a46041f9ca1bf 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 60204204b8bcf45a8262496c641f7033ed6b986d..bbfd87074ce391bbb30f1eb53593769b9ba516d2 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 b7111e7840013befb88f1c7acdd0b9a4be73cfce..87571d8b1a1cfe71f99c1f5e629321c2378759f2 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 367542980ae6e0bad3e664588639a0730c8b955e..231d4884ca23e442139d26e30e1ea2e748d59406 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 e2113ac212e088ddcd6315e33dfca0575742e672..4d0f2d41f784d2e32810df146cb68bd384ac86f5 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 b235a939b7b1d0cdd62be6fb40166f2818c0807d..61e7655e8e156afc176119bb81a2f18d97a1da67 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 2b4c4b24f57f2fe77d530070195ddde0ac9f9ff5..326c7948212323e12636ab95a110596b802e8b0a 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 59a01d6f9b5d12f99d19dd708799f6dbb0bfe26e..2c5d80af563f66bd6e1cab7f6c8ea4c5bef54a85 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 1dfdb60409a43b329f2c0bd221f680b8d0c2b8db..8a7b28f824d5f7514d6eac8cc2c99c253aded252 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 907f73e0872ab8cf1e473a478a770c035262ced5..b808c1711cd5b485f8599b8776cd0f28aae38d12 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 ddbf15d312031b2ca946e32a00c2695deb4b830a..4513311e59e4a5c5a97782411e8f23bca2f1f1b9 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 56323ea7a27766a84ada32ca1cd1c15f272fc321..f1cab0827322ecb41413ecad79bf08d09f4e8cd9 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 37f584881453d786c8328a080a1dc3e401600600..29bd3987763b3151c68821ffc334d113d209a548 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 47c4ae90b36c2016c92690f5c879f7b745fb9a29..9eb65d602519339b48e3b2eb207c275ba9215e82 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 7d67db1173fdd9fea5db6a8a1bca009a4504bf5e..4acaebae1a0fe203edfe4e6dcc198d9ec20c9e68 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 49213bb0192b8d7b67a1b0680c2fe6fd6f571863..a01aa7d6592b936c40027bfc911a310b9d14d582 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 e04102b500178061fe0ead41cb8e9ca2da15e3c2..5d93f34df135ae5e513283e24d02e6e653485e8b 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 2ca82fad3d50726b4c41dcda88ae2968ec077cf1..2c6ba1fe2861f2aedee3c015cf7698244855f4b4 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 0689ea5c5112d65bb6f1e609c9bd7cfdda15981e..c2f971efe33d092e26c547fb1e43dd2e68ae1942 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 a4427f04d32eaf3aa43d0215b54291059cbb73da..b948ee702f98b9816825bdd2eb21a4e8aea58ce3 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 63109c89598de84f1f7dcf31629e9e39ea3e5b37..c3dae07600fc77d2bcb9e4cf49b8db7a93ecaefb 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 ec728d12d03767e4ddf9629439b0c24125dfe445..8931bec9965940298d6ad80154745d3f5e323858 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 ef8c72d1ddee5fee19a1e4d9a2baf7d014ccf7bd..83b7b49f799aa98fe4e28adbb72a70ec10e2ace6 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 1747572e8acdf52b9a9fab88bf036b47c780daf6..76fd3ddcda625fdee6bfd7fb5b1f576a4e495515 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 a020c3e8438643b7ecad2243db932c69e4f3fd1f..e2021537ff6ba94b97b4832f65987ee2e034e5a9 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 bbf2f9e4b8c6e70f29a0ed46355bbb88a7c2b39a..6d6be8bddbb2424885fc5d101d893adbffb8b8f8 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 98c088f587739aabf29df03bbfcc5525c01cd44c..37e110561772c864fcbce05bdfbca6049b1eff91 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 5f5710bc92658b23e2f3feede4bb414be99d9856..15fb5c5522946485fcc74b823f0161c09e8d526b 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 9b5980a073b41033c807b3f58b4f8a46d46de7de..f87e44d009d9c17e9d2c1e29d3cb2d1264f56dd7 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 335c5cade19ffb8e6f04188e19684e6d66c094ca..cb303e494104c0dc6717b268b758489f9266b10c 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 64b219cc4e0ab08a789967fca87b4658ccec81f8..256b2f0f7fc9575ca75fd43c9fc45680bb7fcd3d 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 7624c81b97097836b647856b3006965f47d79d0c..990b92526fd6f4e9d606a20588be26eea1322a4c 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 c38e6e7fd37c18b9e8936e9bc0d2fa97c2064f9a..fdaa00dd116841bc48f3aa6031d25952f4a4a044 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 d8425c4e44e2340692bf23a36e63c13af064c611..8d243e457da7031210d63244628323e74dccb3e5 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 a620f88af2208afadb44c6fce6e00adc19e53783..1bea68903da01f78bce127578c4d1ea90c864d96 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 398234be7dd6101a7d209e62c000ded821b8690a..730fa753fec7fb48fbe54a2de4f4598401d63177 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 73babc0679481fec7e58c77ae78d833b4122b8a7..ab84008bd1634a3047c911f9cf25569cf0e0de54 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 3e8f6a88a5d400cedb1bba8976d3cd040b73ef85..eb6994a294f01fda61308df15129cd68581e6b24 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 0cc6659f5770a51bfefe1339f1d9c77ee66f6162..018cb9090aa5e2c2acaeb67c4e40713bbe7c85ae 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 944776858d91797326e76d2821dc0a1d0e9c9856..8a6936a412934aa873fd6c43ef4bcffb25b1885c 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 235bb871b4e2255e2c72e5b2ded19e7045bc78d9..ff9b542413feecbabf46e5205e4a3307615307ef 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 832606a93f5029f08d57fe45c705ada8f55cbd98..d468163494dfa7f695ba1a71de95e5266c854398 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 5848e5cf0f56debc12b6ee53351406d69723d170..dd4e72261f5cd2715418580c468c99326fc3cb2a 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 08260915c6ed720df7d1372916c25e85ea2c5209..15b26b1be1b9a254d3abf8e6b5918f7d5e2acc7f 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 58333e07e2001a145edcea2a80abfdf3dc07152a..ffd2b6c8e0bee8871c3f54311d9e91782a1a3ebc 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 d6763cc4787130ea2942ed86ba0da87b8d9c81d4..7115445df009076bcfafe88c7ea8405669319749 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 09a6a6b6ceb252f7b65f1deed7211eaaabbd3f22..0dcfb4a27ddd93f6206639e1ce3f8eb7951f1ec0 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 ff665bd6358ea306511b97cdb9cfb8ff5f9f993a..07ad520e6fd336e7bce45fb89bc518af3ad58b54 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 602e31d908c9b87ae6b0e17762c2a305ce9b2667..cc6e36a88f392b228c4d72deed4e27942cb9aec3 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 5379ebbf8ec52e6f948fea67d967669616128632..527cb19523d5293d3b663e5d00b086b2aa049b99 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 907fee56e089a480d0362bc5d5a5558548d7ab5a..39e01aa45ac08b50ae50ba2c701a58238ecdc807 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 974abbfb25188c9055992e84232f74d8ca3dd77c..fdd2c2b181f4f6f7775369f492883aac3889aaf3 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 f490aff7fd28d1b6c4b89a810b53783ce8a04657..fe530f6e21cd25a3e93736a644f9ca51c2a79303 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 c612140b48113f89e1011cbca14daccb19072988..4b126a355f93b58e20f0e0568ac1dde11a44b0a4 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 cd0b24b94110470cdd97ff1df74e680e278f952f..1729eaac36ece6805ca384f2697718503d2e21c1 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 137276b73eb1839d4661ded2ee94e83877f8ed60..97e327029e50b0f0a7cdc7485c6b182e8e2247ad 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 855bf64692099701b2974441386b53d91ac829b7..78ed019f93f16476bb48ab71ec3993f09ba5d9b8 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 7666b522f6c2c50be7ede0fc0c5bb4ca2b1d623f..7b52f73cf61e41d9d020cadacc3e5864a442d07a 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 4996dc9069507d71f7f92010101b221c23ae4e40..4b3fa4b89c77a24d50f22f0d9e02c32bcd892c7c 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 a7904caf79d75d2e04c2d8624591f91d5542e8f2..f71270296d5bc5458326dcfcbce23f10417bd8c9 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 7159bcda4e27951d309992207fa1230c0d67e7f3..dde4c0ed4b69ecbb061d00465eaf956e0323c581 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 2ac39c4b3ef3e50ee2a4c59cdca9c00fe89e0412..feaf6a2f734504649d3d58817422a2de367c7b59 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 23289c92e6f70fcbee3698292673d5b26be89d71..f9ef6f5ed6760055e8d000eae330e8c9e2c4097b 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 fc863fa605c7ecdbc5e98154ddb220c8d4a52a3e..c488e9f57730665e1d02db68dde1aedac5343c57 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 5d5ab829305d8003f1d397b7a58725aa306be12f..f005602d39247f4fff3f2f35973662d1b4d9cd8d 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 88679a410283d068811907558e940660e9626cbb..f67d47c198ba7c136a50d04e6e7557c98f5568d7 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 d820618be59a43a62323e02391c31f212fe7a4a7..247a7921cb414d755ab20ad035dee9eee52a8b71 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 9855a947c28cf887c791578432cb5549962b77a0..653daa220df992449e0052a3d18aad34e3d8bfd1 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 f35003bd286bd4c4bc70cd10ecede15a0b5f88d4..5d993c24d7a94e9804ef3d105d7610547fa40842 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 2a2070afbb086d855a0133cf2ac7108606d35e14..bce64a1d0494a4bcbea437ae00de5757166c2ad2 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 f23fb65cdff24871833c184ff8f3526cd91e261d..58e0be36cd7de7fffd99052104528761a4ac19c2 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 f90a15aebc1de0728960f1b5d39320a85446df2b..3b8362c36143f0c92d6bd4a9990173315a485e4b 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 6b95abfaa66f73efe43bb45e04290f33729830c5..68bd2932c0d323bf59719064f886aa33a2706e4c 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 33655da70a3633e2890826809a2f0923e300df93..a9422d89402bb72001c72c7c0e17b1369560015d 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 5bdc88f4dc5fad8cc25e11824f928fe3cc439dc6..bfd16413b05bbeee397c32936ec8f7d54ac80b06 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 5527502e63835fbe378dd3e618fab797c16faed6..ff7cead260e602991190d0cfa8a215038c5cc1e8 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 297913c8a805dd66110786378930a7070dd9d126..35d6eb50cdeeda142c645ac5ccb53638bae6b3ad 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 5de69c0950dd33b9da7675467be5c95774e73146..e11a674108cc4013cb9cf4b0a74bd2152688f7e8 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 08633acafcc0c33242a7d318fbc861362245ff56..94364aa97704e72aa404a0f3a4c6f30c99b9aa24 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 cf0a47987a9b93b5e6f31dbc74300c906c768651..16a9660a0e959451610a29cb75f7c69b17785957 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 127ed4f9f1270cc8ee0fc8e38d6067eceee3dbfe..167ec8a2728058848a3b41f125171b895872b3b2 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 696bad1e37ccc507c68d52131bd7fb0a518224e6..21f5ce5ff54956f91444c53fad28b3c2d3deb351 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 f91dd1985563066841a1f0ece53dc1140947ff4e..08cbbbd766cedba17d00885b570ad0fb5949fe59 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 78695c0f756622d2298f00729f3a13cf81b947f7..86564559019ec2583d26774756d2da560cd75c25 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 0216b767a8aebae2038a64cd3a3fc8176e53afa0..7cec0de7fdd679238052a0f012e115157509c603 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 f482873d543942fd70aa3d16d0fdf623deb73b22..9f3e917f59ac62864b75826b8881f4f491f054fc 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