diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8799f48bf85088b0e645a99446db62917647453c..dd85809805e4924895da7d80ad454608640021b1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,15 +1,22 @@ include: - project: pole-is/tools/ci-config - ref: "1.10.0" - file: /php-package-ci.yml + ref: "2.2.1" + file: /defaults.yml - project: pole-is/tools/ci-config - ref: "1.10.0" - file: /nodejs-ci.yml + ref: "2.2.1" + file: /php/package.yml + - project: pole-is/tools/ci-config + ref: "2.2.1" + file: /php/packagist.yml + - project: pole-is/tools/ci-config + ref: "2.2.1" + file: /node/base.yml stages: - vendor - test - test-generated + - deploy variables: PHP_VERSION: "7.1" @@ -37,7 +44,7 @@ npm:test: test:tsc: stage: test-generated extends: .nodejs - dependencies: + needs: - node_modules - test:generate script: diff --git a/.php_cs.dist b/.php_cs.dist index a01069cce5e3d9f5ded559f393442a462ee4192a..cadc9a91a3b62960bc160f137d91f9d014aeb27d 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -1,7 +1,5 @@ <?php declare(strict_types=1); -require __DIR__ . '/vendor/autoload.php'; - $finder = PhpCsFixer\Finder::create() ->files() ->name('*.php') @@ -9,8 +7,13 @@ $finder = PhpCsFixer\Finder::create() ->exclude('tests/Fixtures/var') ->in('.'); -return Irstea\CS\Config::create() - ->setIndent(' ') - ->setLineEnding("\n") - ->setFinder($finder); +$loader = require __DIR__ . '/vendor/autoload.php'; +try { + return Irstea\CS\Config::create() + ->setIndent(' ') + ->setLineEnding("\n") + ->setFinder($finder); +} finally { + $loader->unregister(); +} diff --git a/composer.json b/composer.json index 35b756fab0bd84482c4dc5dc5624d947b134b34f..e6a055acc76e491034b91d07b5541b8f4479e052 100644 --- a/composer.json +++ b/composer.json @@ -87,7 +87,7 @@ "test:lint": "@php vendor/bin/parallel-lint src/php tests -j $(nproc)", "test:php-cs-fixer": "@php vendor/bin/php-cs-fixer fix --dry-run --verbose --using-cache=false --show-progress=none --no-interaction", "test:phpmd": "@php vendor/bin/phpmd src/php,tests text ./phpmd-ruleset.xml", - "test:phpcpd": "@php vendor/bin/phpcpd src/php tests --no-interaction --exclude=Fixtures/var", + "test:phpcpd": "@php vendor/bin/phpcpd src/php tests --no-interaction --exclude=Fixtures/var --names-exclude=ClassInfoTest.php", "test:phpstan": "@php vendor/bin/phpstan analyse --no-progress --no-interaction", "test:composer-require-checker": "@php -d xdebug.max_nesting_level=1000 vendor/bin/composer-require-checker --ignore-parse-errors", "test:phpunit": "@php vendor/bin/phpunit --colors=never --coverage-text", diff --git a/composer.lock b/composer.lock index 88df81847441f74137d25e35d5db5bc927be48b7..7d13d165e502e8c90b1574d091fe413d8ee78f76 100644 Binary files a/composer.lock and b/composer.lock differ diff --git a/src/php/Command/NgModelGenerateCommand.php b/src/php/Command/NgModelGenerateCommand.php index 300102cab27ec0dbe29eaa3cd8605e0d3ab86a81..57f2890820fc05937ce07b4fd89d295cd7382353 100644 --- a/src/php/Command/NgModelGenerateCommand.php +++ b/src/php/Command/NgModelGenerateCommand.php @@ -52,9 +52,6 @@ final class NgModelGenerateCommand extends Command /** * NgModelGenerateCommand constructor. - * - * @param ModelGenerator $generator - * @param Documentation $documentation */ public function __construct( ModelGenerator $generator, @@ -113,12 +110,6 @@ final class NgModelGenerateCommand extends Command } } - /** - * @param InputInterface $input - * @param OutputInterface $output - * - * @return MultiFileWriter - */ private function openWriter(InputInterface $input, OutputInterface $output): MultiFileWriter { $zipPath = $input->getOption('zip'); @@ -142,12 +133,6 @@ final class NgModelGenerateCommand extends Command return new ConsoleWriter($output); } - /** - * @param string $path - * @param bool $force - * - * @return \ZipArchive - */ private function openZipArchive(string $path, bool $force): \ZipArchive { $archive = new \ZipArchive(); diff --git a/src/php/Command/NgModelMetadataCommand.php b/src/php/Command/NgModelMetadataCommand.php index f01f7fcebe4fac9758905a188b521fed2fab5e23..2c3fc659de367655e232d107fb55e2d0b4fc94dc 100644 --- a/src/php/Command/NgModelMetadataCommand.php +++ b/src/php/Command/NgModelMetadataCommand.php @@ -47,9 +47,6 @@ final class NgModelMetadataCommand extends Command /** * NgModelGenerateCommand constructor. - * - * @param MetadataFactoryInterface $metadataFactory - * @param Documentation $documentation */ public function __construct( MetadataFactoryInterface $metadataFactory, diff --git a/src/php/Iterators/CallbackFilterRecursorIterator.php b/src/php/Iterators/CallbackFilterRecursorIterator.php index ddb35becae3d85ebd852573130e0d65f1ad240b5..a5fe8243f286b57e9da2cc43bc348de96b166e5d 100644 --- a/src/php/Iterators/CallbackFilterRecursorIterator.php +++ b/src/php/Iterators/CallbackFilterRecursorIterator.php @@ -54,8 +54,6 @@ class CallbackFilterRecursorIterator extends RecursorIterator /** * @param \Iterator $iter - * - * @return \RecursiveIterator */ protected function doGetChildren(\Traversable $iter): \RecursiveIterator { diff --git a/src/php/Iterators/IteratorBuilder.php b/src/php/Iterators/IteratorBuilder.php index e0fb1b9377070df9c581743669a4a75c5e7333b0..637e9e2a0852140ad72669429538184f9438c851 100644 --- a/src/php/Iterators/IteratorBuilder.php +++ b/src/php/Iterators/IteratorBuilder.php @@ -63,8 +63,6 @@ final class IteratorBuilder implements \IteratorAggregate } /** - * @param int $mode - * * @return IteratorBuilder */ public function recurse(int $mode): self @@ -79,9 +77,6 @@ final class IteratorBuilder implements \IteratorAggregate } /** - * @param int $mode - * @param callable $filter - * * @return IteratorBuilder */ public function recurseWhere(int $mode, callable $filter): self @@ -97,8 +92,6 @@ final class IteratorBuilder implements \IteratorAggregate } /** - * @param callable $where - * * @return IteratorBuilder */ public function where(callable $where): self diff --git a/src/php/Iterators/RecursorIterator.php b/src/php/Iterators/RecursorIterator.php index f2f481bf4d9a9eadf7c4023250571e9849011d4f..87643b014db35f98cf2e0407ee6588cec37e04fd 100644 --- a/src/php/Iterators/RecursorIterator.php +++ b/src/php/Iterators/RecursorIterator.php @@ -55,11 +55,6 @@ class RecursorIterator extends \IteratorIterator implements \RecursiveIterator return $this->doGetChildren($iter); } - /** - * @param \Traversable $iter - * - * @return \RecursiveIterator - */ protected function doGetChildren(\Traversable $iter): \RecursiveIterator { return new self($iter); diff --git a/src/php/Iterators/UniqueFilter.php b/src/php/Iterators/UniqueFilter.php index 6ed27fb117cb77f3a601f261aac03b4441c4f29a..022089afbd7482ec1fa98866e4cdded8a9ef3234 100644 --- a/src/php/Iterators/UniqueFilter.php +++ b/src/php/Iterators/UniqueFilter.php @@ -33,8 +33,6 @@ final class UniqueFilter /** * @param mixed $value - * - * @return bool */ public function __invoke($value): bool { @@ -47,8 +45,6 @@ final class UniqueFilter /** * @param mixed $value - * - * @return string */ private function getKey($value): string { diff --git a/src/php/Metadata/CachingMetadataFactory.php b/src/php/Metadata/CachingMetadataFactory.php index 32e79cc5e17af8fb3f3ec8df3550513256dd56c8..bd832ee3077ebb821773100fbeda7ae75940dcf3 100644 --- a/src/php/Metadata/CachingMetadataFactory.php +++ b/src/php/Metadata/CachingMetadataFactory.php @@ -38,9 +38,6 @@ final class CachingMetadataFactory implements MetadataFactoryInterface /** * CachedMetadataFactory constructor. - * - * @param MetadataFactoryInterface $inner - * @param Cache|null $cache */ public function __construct(MetadataFactoryInterface $inner, Cache $cache = null) { @@ -67,10 +64,6 @@ final class CachingMetadataFactory implements MetadataFactoryInterface } /** - * @param string $namespace - * @param string $key - * @param callable $compute - * * @return mixed */ private function memoize(string $namespace, string $key, callable $compute) diff --git a/src/php/Metadata/ClassHierarchy.php b/src/php/Metadata/ClassHierarchy.php index 9c4d253c2b54402460079ed79fb9a0edf8e3e1dc..878db9b93db07647ff6da28a6c83f2ac3f31fa9d 100644 --- a/src/php/Metadata/ClassHierarchy.php +++ b/src/php/Metadata/ClassHierarchy.php @@ -28,16 +28,9 @@ use Irstea\NgModelGeneratorBundle\Models\ClassName; */ interface ClassHierarchy { - /** - * @param ClassName $class - * - * @return ClassName|null - */ public function getParent(ClassName $class): ?ClassName; /** - * @param ClassName $class - * * @return ClassName[] */ public function getChildren(ClassName $class): array; diff --git a/src/php/Metadata/MetadataFactory.php b/src/php/Metadata/MetadataFactory.php index 0da2bf96d2d81213d04dc45118c340190558efc8..f68682e58c586b4ecf65995f69aa1435b16c246a 100644 --- a/src/php/Metadata/MetadataFactory.php +++ b/src/php/Metadata/MetadataFactory.php @@ -84,17 +84,6 @@ final class MetadataFactory implements MetadataFactoryInterface /** * MetadataFactory constructor. - * - * @param ResourceClassResolverInterface $resourceClassResolver - * @param ResourceMetadataFactoryInterface $resourceMetadataFactory - * @param PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory - * @param PropertyMetadataFactoryInterface $propertyMetadataFactory - * @param PropertyInfoExtractorInterface $propertyInfoExtractor - * @param OperationMethodResolverInterface $operationMethodResolver - * @param ContainerInterface $filterLocator - * @param PaginationMetadata $paginationMetadata - * @param RouterInterface $router - * @param ClassHierarchy $classHierarchy */ public function __construct( ResourceClassResolverInterface $resourceClassResolver, @@ -156,12 +145,6 @@ final class MetadataFactory implements MetadataFactoryInterface ); } - /** - * @param bool $enabled - * @param bool $clientItemsPerPage - * - * @return PaginationMetadata - */ private function buildPagination(bool $enabled, bool $clientItemsPerPage): PaginationMetadata { return new PaginationMetadata( @@ -174,8 +157,6 @@ final class MetadataFactory implements MetadataFactoryInterface /** * Get paginationMetadata. - * - * @return PaginationMetadata */ public function getPaginationMetadata(): PaginationMetadata { @@ -183,8 +164,6 @@ final class MetadataFactory implements MetadataFactoryInterface } /** - * @param ClassName $class - * * @throws PropertyNotFoundException * @throws ResourceClassNotFoundException * @throws \ReflectionException @@ -213,17 +192,9 @@ final class MetadataFactory implements MetadataFactoryInterface } /** - * @param ClassName $class - * @param APIResourceMetadata $resourceMetadata - * @param string $name - * @param string $type - * @param array $operation - * * @throws PropertyNotFoundException * @throws ResourceClassNotFoundException * @throws \ReflectionException - * - * @return OperationMetadata */ private function getOperation( ClassName $class, @@ -311,14 +282,6 @@ final class MetadataFactory implements MetadataFactoryInterface ); } - /** - * @param ClassName $class - * @param string $type - * @param string $name - * @param string $method - * - * @return string - */ private function getOperationPath(ClassName $class, string $type, string $name, string $method): string { $className = $class->getFullName(); @@ -344,9 +307,6 @@ final class MetadataFactory implements MetadataFactoryInterface } /** - * @param ClassName $class - * @param array $filterIds - * * @return FilterInterface[] */ private function getFilters(ClassName $class, array $filterIds): array @@ -367,16 +327,11 @@ final class MetadataFactory implements MetadataFactoryInterface /** * @parma string $operationName * - * @param OperationDef|null $opDef - * @param ClassName $class - * @param bool $normalization - * @param string[] $groups + * @param string[] $groups * * @throws PropertyNotFoundException * @throws ResourceClassNotFoundException * @throws \ReflectionException - * - * @return SerializationMetadata */ private function getOperationSerialization( ?OperationDef $opDef, @@ -395,16 +350,12 @@ final class MetadataFactory implements MetadataFactoryInterface } /** - * @param ClassName $class - * @param bool $normalization * @param OperationDef $opDef * @param string[] $groups * * @throws PropertyNotFoundException * @throws ResourceClassNotFoundException * @throws \ReflectionException - * - * @return SerializationMetadata */ private function doGetSerialization(ClassName $class, bool $normalization, ?OperationDef $opDef, array $groups): SerializationMetadata { @@ -474,15 +425,7 @@ final class MetadataFactory implements MetadataFactoryInterface } /** - * @param ClassName $root - * @param ClassName $class - * @param bool $normalization - * @param OperationDef|null $opDef - * @param array $groups - * * @throws ResourceClassNotFoundException - * - * @return string */ private function getRepresentationName( ClassName $root, @@ -515,11 +458,7 @@ final class MetadataFactory implements MetadataFactoryInterface } /** - * @param ClassName $class - * * @throws ResourceClassNotFoundException - * - * @return array */ private function getDefaultGroups(ClassName $class): array { diff --git a/src/php/Metadata/MetadataFactoryInterface.php b/src/php/Metadata/MetadataFactoryInterface.php index 8aaeb77010ddf8db5dbbef4cef2a0fed12644b53..a925320352708c859ba7d3e66a29a5f48ca4a103 100644 --- a/src/php/Metadata/MetadataFactoryInterface.php +++ b/src/php/Metadata/MetadataFactoryInterface.php @@ -28,22 +28,9 @@ use Irstea\NgModelGeneratorBundle\Models\ClassName; */ interface MetadataFactoryInterface { - /** - * @param ClassName $class - * - * @return bool - */ public function isResource(ClassName $class): bool; - /** - * @param ClassName $class - * - * @return ResourceMetadata - */ public function getResourceMetadata(ClassName $class): ResourceMetadata; - /** - * @return PaginationMetadata - */ public function getPaginationMetadata(): PaginationMetadata; } diff --git a/src/php/Metadata/OperationDef.php b/src/php/Metadata/OperationDef.php index 05e482cc4a02e73b8ae933228cafb07404d4ff37..8c4391e3fdfd40274ed5de346f673856c9640147 100644 --- a/src/php/Metadata/OperationDef.php +++ b/src/php/Metadata/OperationDef.php @@ -46,10 +46,6 @@ final class OperationDef implements \JsonSerializable, HasName /** * OperationDef constructor. - * - * @param string $name - * @param string $method - * @param bool $isCollection */ public function __construct(string $name, string $method, bool $isCollection) { @@ -83,57 +79,36 @@ final class OperationDef implements \JsonSerializable, HasName $this->name = $name; } - /** - * @return bool - */ public function hasNormalization(): bool { return \in_array($this->method, ['GET', 'PUT', 'POST']); } - /** - * @return bool - */ public function hasDenormalization(): bool { return \in_array($this->method, ['PUT', 'POST']); } - /** - * @return bool - */ public function isGetItem(): bool { return $this->special === 'GET' && !$this->isCollection; } - /** - * @return bool - */ public function isCreateItem(): bool { return $this->special === 'POST' && !$this->isCollection; } - /** - * @return bool - */ public function isUpdateItem(): bool { return $this->special === 'PUT' && !$this->isCollection; } - /** - * @return bool - */ public function isDeleteItem(): bool { return $this->special === 'DELETE' && !$this->isCollection; } - /** - * @return bool - */ public function isGetCollection(): bool { return $this->method === 'GET' && $this->isCollection; @@ -141,8 +116,6 @@ final class OperationDef implements \JsonSerializable, HasName /** * Get name. - * - * @return string */ public function getName(): string { @@ -151,8 +124,6 @@ final class OperationDef implements \JsonSerializable, HasName /** * Get originalName. - * - * @return string */ public function getOriginalName(): string { @@ -161,8 +132,6 @@ final class OperationDef implements \JsonSerializable, HasName /** * Get method. - * - * @return string */ public function getMethod(): string { @@ -171,8 +140,6 @@ final class OperationDef implements \JsonSerializable, HasName /** * Get isCollection. - * - * @return bool */ public function isCollection(): bool { diff --git a/src/php/Metadata/OperationMetadata.php b/src/php/Metadata/OperationMetadata.php index bdc80b79b47045a34529a866ac83b6d50041485a..62316c009a05763e4aa9dafc418da8450805f5d1 100644 --- a/src/php/Metadata/OperationMetadata.php +++ b/src/php/Metadata/OperationMetadata.php @@ -58,15 +58,6 @@ class OperationMetadata implements \JsonSerializable, HasName /** * OperationMetadata constructor. - * - * @param OperationDef $opDef - * @param string $description - * @param string $path - * @param array $requirements - * @param array $filters - * @param PaginationMetadata|null $pagination - * @param SerializationMetadata|null $normalization - * @param SerializationMetadata|null $denormalization */ public function __construct( OperationDef $opDef, @@ -89,8 +80,6 @@ class OperationMetadata implements \JsonSerializable, HasName } /** - * @param ResourceMetadata $resource - * * @return OperationMetadata */ public function withResource(ResourceMetadata $resource): self @@ -103,8 +92,6 @@ class OperationMetadata implements \JsonSerializable, HasName /** * Get className. - * - * @return string */ public function getClassName(): string { @@ -113,8 +100,6 @@ class OperationMetadata implements \JsonSerializable, HasName /** * Get opDef. - * - * @return OperationDef */ public function getOpDef(): OperationDef { @@ -123,8 +108,6 @@ class OperationMetadata implements \JsonSerializable, HasName /** * Get name. - * - * @return string */ public function getName(): string { @@ -133,8 +116,6 @@ class OperationMetadata implements \JsonSerializable, HasName /** * Get description. - * - * @return string */ public function getDescription(): string { @@ -143,25 +124,17 @@ class OperationMetadata implements \JsonSerializable, HasName /** * Get type. - * - * @return string */ public function getType(): string { return $this->opDef->isCollection() ? 'collection' : 'item'; } - /** - * @return bool - */ public function isItemOperation(): bool { return !$this->opDef->isCollection(); } - /** - * @return bool - */ public function isCollectionOperation(): bool { return $this->opDef->isCollection(); @@ -169,8 +142,6 @@ class OperationMetadata implements \JsonSerializable, HasName /** * Get method. - * - * @return string */ public function getMethod(): string { @@ -179,8 +150,6 @@ class OperationMetadata implements \JsonSerializable, HasName /** * Get path. - * - * @return string */ public function getPath(): string { @@ -199,8 +168,6 @@ class OperationMetadata implements \JsonSerializable, HasName /** * Get pagination. - * - * @return PaginationMetadata|null */ public function getPagination(): ?PaginationMetadata { @@ -219,8 +186,6 @@ class OperationMetadata implements \JsonSerializable, HasName /** * Get normalization. - * - * @return SerializationMetadata|null */ public function getNormalization(): ?SerializationMetadata { @@ -229,8 +194,6 @@ class OperationMetadata implements \JsonSerializable, HasName /** * Get denormalization. - * - * @return SerializationMetadata|null */ public function getDenormalization(): ?SerializationMetadata { @@ -239,8 +202,6 @@ class OperationMetadata implements \JsonSerializable, HasName /** * Get resource. - * - * @return ResourceMetadata */ public function getResource(): ResourceMetadata { diff --git a/src/php/Metadata/PaginationMetadata.php b/src/php/Metadata/PaginationMetadata.php index 560bab197550b61a17601d1848e7b675cfac807b..0af323eb59804df2326346b70573141c9dfdbfbb 100644 --- a/src/php/Metadata/PaginationMetadata.php +++ b/src/php/Metadata/PaginationMetadata.php @@ -42,11 +42,6 @@ final class PaginationMetadata implements \JsonSerializable /** * PaginationMetadata constructor. - * - * @param bool $enabled - * @param string $pageParameterName - * @param bool $clientItemsPerPage - * @param string $itemsPerPageParameterName */ public function __construct(bool $enabled, string $pageParameterName, bool $clientItemsPerPage, string $itemsPerPageParameterName) { @@ -58,8 +53,6 @@ final class PaginationMetadata implements \JsonSerializable /** * Get enabled. - * - * @return bool */ public function isEnabled(): bool { @@ -68,8 +61,6 @@ final class PaginationMetadata implements \JsonSerializable /** * Get pageParameterName. - * - * @return string */ public function getPageParameterName(): string { @@ -78,8 +69,6 @@ final class PaginationMetadata implements \JsonSerializable /** * Get clientItemsPerPage. - * - * @return bool */ public function isClientItemsPerPage(): bool { @@ -88,8 +77,6 @@ final class PaginationMetadata implements \JsonSerializable /** * Get itemsPerPageParameterName. - * - * @return string */ public function getItemsPerPageParameterName(): string { diff --git a/src/php/Metadata/PropertyMetadata.php b/src/php/Metadata/PropertyMetadata.php index d6c47acd3155a45762b192757bbddad4b728b908..0534ffadd9807135089559acc44efcca7b6e984a 100644 --- a/src/php/Metadata/PropertyMetadata.php +++ b/src/php/Metadata/PropertyMetadata.php @@ -62,17 +62,6 @@ class PropertyMetadata implements \JsonSerializable, HasName /** * PropertyMetadata constructor. - * - * @param string $name - * @param string $description - * @param Type $type - * @param bool $identifier - * @param bool $nullable - * @param bool $readable - * @param bool $writable - * @param bool $initializable - * @param bool $link - * @param bool $embedded */ public function __construct( string $name, @@ -100,8 +89,6 @@ class PropertyMetadata implements \JsonSerializable, HasName /** * Get name. - * - * @return string */ public function getName(): string { @@ -110,8 +97,6 @@ class PropertyMetadata implements \JsonSerializable, HasName /** * Get description. - * - * @return string */ public function getDescription(): string { @@ -120,17 +105,12 @@ class PropertyMetadata implements \JsonSerializable, HasName /** * Get type. - * - * @return Type */ public function getType(): Type { return $this->type; } - /** - * @return Type - */ public function getLeafType(): Type { $type = $this->type; @@ -144,8 +124,6 @@ class PropertyMetadata implements \JsonSerializable, HasName /** * Get identifier. - * - * @return bool */ public function isIdentifier(): bool { @@ -154,8 +132,6 @@ class PropertyMetadata implements \JsonSerializable, HasName /** * Get readable. - * - * @return bool */ public function isReadable(): bool { @@ -164,17 +140,12 @@ class PropertyMetadata implements \JsonSerializable, HasName /** * Get writable. - * - * @return bool */ public function isWritable(): bool { return $this->writable; } - /** - * @return bool - */ public function isNullable(): bool { return $this->nullable; @@ -182,8 +153,6 @@ class PropertyMetadata implements \JsonSerializable, HasName /** * Get initializable. - * - * @return bool */ public function isInitializable(): bool { @@ -192,8 +161,6 @@ class PropertyMetadata implements \JsonSerializable, HasName /** * Get link. - * - * @return bool */ public function isLink(): bool { @@ -202,8 +169,6 @@ class PropertyMetadata implements \JsonSerializable, HasName /** * Get embedded. - * - * @return bool */ public function isEmbedded(): bool { @@ -223,8 +188,6 @@ class PropertyMetadata implements \JsonSerializable, HasName } /** - * @param Type|null $type - * * @return array|null */ private function serializeType(?Type $type) diff --git a/src/php/Metadata/PropertyMetadataFactory.php b/src/php/Metadata/PropertyMetadataFactory.php index 02165ac1d441c30e9bb37b30613dc66bfa4c610c..7d22c9b0fdbcf5200d9ea77727f2be633a921ab2 100644 --- a/src/php/Metadata/PropertyMetadataFactory.php +++ b/src/php/Metadata/PropertyMetadataFactory.php @@ -62,13 +62,6 @@ class PropertyMetadataFactory /** * PropertyMetadataFactory constructor. - * - * @param ResourceClassResolverInterface $resourceClassResolver - * @param PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory - * @param PropertyMetadataFactoryInterface $propertyMetadataFactory - * @param ClassName $resource - * @param string $mode - * @param array $groups */ public function __construct( ResourceClassResolverInterface $resourceClassResolver, @@ -87,13 +80,8 @@ class PropertyMetadataFactory } /** - * @param ClassName $class - * @param string $propertyName - * * @throws ResourceClassNotFoundException * @throws \ApiPlatform\Core\Exception\PropertyNotFoundException - * - * @return PropertyMetadata */ public function create(ClassName $class, string $propertyName): PropertyMetadata { @@ -120,11 +108,6 @@ class PropertyMetadataFactory ); } - /** - * @param APIPropertyMetadata $propertyMeta - * - * @return array - */ private function getLinkStatus(APIPropertyMetadata $propertyMeta): array { $typeMeta = $propertyMeta->getType(); @@ -145,11 +128,6 @@ class PropertyMetadataFactory return [true, (bool) $embedded]; } - /** - * @param Type $type - * - * @return Type|null - */ private function getLeafType(Type $type): ?Type { while ($type && $type->isCollection()) { @@ -160,8 +138,6 @@ class PropertyMetadataFactory } /** - * @param ClassName $class - * * @throws ResourceClassNotFoundException * @throws \ApiPlatform\Core\Exception\PropertyNotFoundException * @@ -178,8 +154,6 @@ class PropertyMetadataFactory } /** - * @param ClassName $class - * * @throws \ApiPlatform\Core\Exception\PropertyNotFoundException * @throws ResourceClassNotFoundException * @@ -210,12 +184,6 @@ class PropertyMetadataFactory return $properties; } - /** - * @param bool $isResource - * @param APIPropertyMetadata $propertyMeta - * - * @return bool - */ private function acceptProperty(bool $isResource, APIPropertyMetadata $propertyMeta): bool { if (!$isResource && $propertyMeta->isIdentifier()) { diff --git a/src/php/Metadata/RepresentationMetadata.php b/src/php/Metadata/RepresentationMetadata.php index 01519d5c35c23e221651e85ac1436820cfbd3899..6b2dc1ba3f0585753b44335c4ae80f03d7a9c502 100644 --- a/src/php/Metadata/RepresentationMetadata.php +++ b/src/php/Metadata/RepresentationMetadata.php @@ -61,9 +61,6 @@ final class RepresentationMetadata implements ClassName, HasName /** * RepresentationMetadata constructor. * - * @param string $name - * @param ClassName $class - * @param ClassName|null $parent * @param PropertyMetadata[] $properties */ public function __construct(string $name, ClassName $class, ?ClassName $parent, array $properties, bool $abstract, bool $resource) @@ -87,8 +84,6 @@ final class RepresentationMetadata implements ClassName, HasName /** * Get name. - * - * @return string */ public function getName(): string { @@ -129,8 +124,6 @@ final class RepresentationMetadata implements ClassName, HasName /** * Get parent. - * - * @return ClassName|null */ public function getParent(): ?ClassName { @@ -149,8 +142,6 @@ final class RepresentationMetadata implements ClassName, HasName /** * Get abstract. - * - * @return bool */ public function isAbstract(): bool { @@ -159,8 +150,6 @@ final class RepresentationMetadata implements ClassName, HasName /** * Get resource. - * - * @return bool */ public function isResource(): bool { diff --git a/src/php/Metadata/ResourceClassHierarchy.php b/src/php/Metadata/ResourceClassHierarchy.php index 8c233e5ce202e0355ce084e9a8cf803647079138..1f8dcf771e461e3c31812cb07570231415ff3975 100644 --- a/src/php/Metadata/ResourceClassHierarchy.php +++ b/src/php/Metadata/ResourceClassHierarchy.php @@ -46,9 +46,6 @@ final class ResourceClassHierarchy implements ClassHierarchy } } - /** - * @param ClassName $class - */ private function preload(ClassName $class): void { $className = $class->getFullName(); diff --git a/src/php/Metadata/ResourceMetadata.php b/src/php/Metadata/ResourceMetadata.php index 250c3962b4141be08ec2b1b6c9bbc31891f9e3e6..92b02f6802df3fa6c6ae4783f8eeb541d3b35c66 100644 --- a/src/php/Metadata/ResourceMetadata.php +++ b/src/php/Metadata/ResourceMetadata.php @@ -49,12 +49,7 @@ class ResourceMetadata implements ClassName /** * ResourceMetadata constructor. * - * @param ClassName $class - * @param ClassName|null $parentClass - * @param string $description - * @param bool $abstract - * @param SerializationMetadata $defaultNormalization - * @param OperationMetadata[] $operations + * @param OperationMetadata[] $operations */ public function __construct( ClassName $class, @@ -110,8 +105,6 @@ class ResourceMetadata implements ClassName /** * Get parentClass. - * - * @return ClassName|null */ public function getParentClass(): ?ClassName { @@ -120,8 +113,6 @@ class ResourceMetadata implements ClassName /** * Get parentClassName. - * - * @return string|null */ public function getParentClassName(): ?string { @@ -130,8 +121,6 @@ class ResourceMetadata implements ClassName /** * Get description. - * - * @return string */ public function getDescription(): string { @@ -140,8 +129,6 @@ class ResourceMetadata implements ClassName /** * Get abstract. - * - * @return bool */ public function isAbstract(): bool { @@ -160,8 +147,6 @@ class ResourceMetadata implements ClassName /** * Get defaultNormalization. - * - * @return SerializationMetadata */ public function getDefaultNormalization(): SerializationMetadata { diff --git a/src/php/Metadata/SerializationMetadata.php b/src/php/Metadata/SerializationMetadata.php index a010abacf028b4d316bfe0819d3b0399a629b73d..fec99aee57a92b4cd2c9c74c0b8a27ce92e50546 100644 --- a/src/php/Metadata/SerializationMetadata.php +++ b/src/php/Metadata/SerializationMetadata.php @@ -43,9 +43,7 @@ final class SerializationMetadata implements ClassName /** * SerializationMetadata constructor. * - * @param ClassName $root * @param string[] $groups - * @param bool $normalization * @param RepresentationMetadata[] $representations */ public function __construct(ClassName $root, array $groups, bool $normalization, array $representations) @@ -74,8 +72,6 @@ final class SerializationMetadata implements ClassName /** * Get root. - * - * @return ClassName */ public function getRoot(): ClassName { @@ -124,21 +120,11 @@ final class SerializationMetadata implements ClassName return $this->representations; } - /** - * @param ClassName $class - * - * @return bool - */ public function hasRepresentationOf(ClassName $class): bool { return isset($this->representations[$class->getFullName()]); } - /** - * @param ClassName $class - * - * @return RepresentationMetadata - */ public function getRepresentationOf(ClassName $class): RepresentationMetadata { return $this->representations[$class->getFullName()]; @@ -146,8 +132,6 @@ final class SerializationMetadata implements ClassName /** * Get normalization. - * - * @return bool */ public function isNormalization(): bool { diff --git a/src/php/ModelGenerator.php b/src/php/ModelGenerator.php index 20aa3900e97f4708bec3efa2bc7e4bf370135ed8..2a06132de47f16037acd779bb9758de55435d073 100644 --- a/src/php/ModelGenerator.php +++ b/src/php/ModelGenerator.php @@ -65,9 +65,6 @@ final class ModelGenerator /** * Serializer constructor. - * - * @param MetadataFactoryInterface $metadataFactory - * @param Environment $twigEnv */ public function __construct( MetadataFactoryInterface $metadataFactory, @@ -81,9 +78,6 @@ final class ModelGenerator * Génère les modèles Typescript. * Cette méthode n'est pas réentrante. * - * @param Documentation $doc - * @param MultiFileWriter $writer - * * @throws \Twig_Error_Loader * @throws \Twig_Error_Runtime * @throws \Twig_Error_Syntax @@ -106,8 +100,6 @@ final class ModelGenerator } /** - * @param MultiFileWriter $writer - * * @throws \Twig_Error_Loader * @throws \Twig_Error_Runtime * @throws \Twig_Error_Syntax @@ -166,8 +158,6 @@ final class ModelGenerator } /** - * @param MultiFileWriter $writer - * * @throws \Twig_Error_Loader * @throws \Twig_Error_Runtime * @throws \Twig_Error_Syntax @@ -187,8 +177,6 @@ final class ModelGenerator /** * Crée une usine à types contenant un certain nombre de types par défaut. - * - * @return TypeFactoryInterface */ private function createTypeFactory(): TypeFactoryInterface { @@ -223,11 +211,6 @@ final class ModelGenerator return $factory; } - /** - * @param string $name - * - * @return Type - */ private function createCommonFilters(string $name): Type { $properties = []; @@ -243,9 +226,6 @@ final class ModelGenerator return new InterfaceType($name, null, $properties); } - /** - * @return Type - */ private function createOrdering(): Type { return new Alias('Ordering', Union::create([StringConst::get('asc'), StringConst::get('desc')]), 'Allowed values for ordering parameters'); @@ -253,8 +233,6 @@ final class ModelGenerator /** * Retourne un iterateur sur les métadonnées des ressources. - * - * @return \Iterator */ private function getResourceMetadata(): \Iterator { @@ -301,11 +279,6 @@ final class ModelGenerator return $repositories; } - /** - * @param ResourceMetadata $resourceMeta - * - * @return Repository|null - */ private function buildRepositories(ResourceMetadata $resourceMeta): ?Repository { $defaultNormalization = $resourceMeta->getDefaultNormalization(); diff --git a/src/php/Models/ClassInfo.php b/src/php/Models/ClassInfo.php index 1860d8b0f3850d4904ecd01b16e9fa610a50696e..2f271c3cd618d3254afd694964ec1e51b88c9b4b 100644 --- a/src/php/Models/ClassInfo.php +++ b/src/php/Models/ClassInfo.php @@ -61,10 +61,7 @@ final class ClassInfo implements ClassName /** * ClassInfo constructor. * - * @param ClassName $class * @param PropertyMetadata[] $properties - * @param bool $abstract - * @param bool $resource */ public function __construct(ClassName $class, array $properties = [], bool $abstract = false, bool $resource = false) { @@ -124,8 +121,6 @@ final class ClassInfo implements ClassName /** * Get abstract. - * - * @return bool */ public function isAbstract(): bool { @@ -134,8 +129,6 @@ final class ClassInfo implements ClassName /** * Get resource. - * - * @return bool */ public function isResource(): bool { @@ -144,8 +137,6 @@ final class ClassInfo implements ClassName /** * Get parent. - * - * @return ClassInfo|null */ public function getParent(): ?ClassInfo { @@ -154,8 +145,6 @@ final class ClassInfo implements ClassName /** * Set parent. - * - * @param ClassInfo|null $parent */ public function setParent(?ClassInfo $parent): void { @@ -185,8 +174,6 @@ final class ClassInfo implements ClassName } /** - * @param ClassInfo $child - * * @SuppressWarnings(PHPMD.UnusedPrivateMethod) */ private function addChild(ClassInfo $child): void @@ -200,43 +187,27 @@ final class ClassInfo implements ClassName /** * Test type. - * - * @param string $type - * - * @return bool */ public function isType(string $type): bool { return $this->type === $type; } - /** - * @return bool - */ public function isInterface(): bool { return $this->isType(self::INTERFACE); } - /** - * @return bool - */ public function isUnion(): bool { return $this->isType(self::UNION); } - /** - * @return bool - */ public function isUndefined(): bool { return $this->isType(self::UNDEFINED); } - /** - * @return bool - */ public function isIRI(): bool { return $this->isType(self::IRI); @@ -341,9 +312,6 @@ final class ClassInfo implements ClassName $this->virtualProperties = array_replace($this->virtualProperties, $commonProperties); } - /** - * @return bool - */ private function sinkDownProperties(): bool { if ($this->parent) { diff --git a/src/php/Models/ClassName.php b/src/php/Models/ClassName.php index ecd112f4e61a88d67444d33f926453d02a7223cb..08550a97e316a6f5ee4e04fa52b2b18d34763c67 100644 --- a/src/php/Models/ClassName.php +++ b/src/php/Models/ClassName.php @@ -28,21 +28,14 @@ interface ClassName extends \JsonSerializable { /** * Get namespace. - * - * @return string */ public function getNamespace(): string; /** * Get baseName. - * - * @return string */ public function getBaseName(): string; - /** - * @return string - */ public function getFullName(): string; /** diff --git a/src/php/Models/Declaration.php b/src/php/Models/Declaration.php index 0748f1343786e866b18e7085c3d3233c26df947e..009467d6ea39411af0e5330a8c4ef126308cf51a 100644 --- a/src/php/Models/Declaration.php +++ b/src/php/Models/Declaration.php @@ -26,13 +26,7 @@ namespace Irstea\NgModelGeneratorBundle\Models; */ interface Declaration extends HasName { - /** - * @return string - */ public function getDeclaration(): string; - /** - * @return string - */ public function getDescription(): string; } diff --git a/src/php/Models/DeclarationTrait.php b/src/php/Models/DeclarationTrait.php index 96a4578e16b1132cc3d2508a50473001676ae23a..e6e48cd669c36ed8ea29572a3249ce17cad7faa7 100644 --- a/src/php/Models/DeclarationTrait.php +++ b/src/php/Models/DeclarationTrait.php @@ -31,9 +31,6 @@ trait DeclarationTrait /** @var string */ protected $description = ''; - /** - * @return string - */ public function getDescription(): string { return $this->description; diff --git a/src/php/Models/HasName.php b/src/php/Models/HasName.php index dd725bf37594a3ee6a852b62c2f11a17c4fdb1df..6ae177c90114feac5ff742e4b8aa08ab2f1b0bfc 100644 --- a/src/php/Models/HasName.php +++ b/src/php/Models/HasName.php @@ -26,8 +26,5 @@ namespace Irstea\NgModelGeneratorBundle\Models; */ interface HasName { - /** - * @return string - */ public function getName(): string; } diff --git a/src/php/Models/MultitonTrait.php b/src/php/Models/MultitonTrait.php index 5bb43f2bbf1d24ec15b109adebd35d21259ca1a4..e7016d090246eb29264d2156d1b65966ef77240b 100644 --- a/src/php/Models/MultitonTrait.php +++ b/src/php/Models/MultitonTrait.php @@ -27,8 +27,6 @@ namespace Irstea\NgModelGeneratorBundle\Models; trait MultitonTrait { /** - * @param string $name - * * @return static */ public static function get(string $name): self diff --git a/src/php/Models/NamedTrait.php b/src/php/Models/NamedTrait.php index 7b35972796c8c26a2b2769bfa18572c412a35f5a..e8742836ee48a525dcbcf9dd6931b8bac03d3137 100644 --- a/src/php/Models/NamedTrait.php +++ b/src/php/Models/NamedTrait.php @@ -31,9 +31,6 @@ trait NamedTrait */ protected $name; - /** - * @return string - */ public function getName(): string { return $this->name; diff --git a/src/php/Models/PHPClass.php b/src/php/Models/PHPClass.php index bdb6952f63fd7bd885002f0e1bfc8045f0603d48..cda6d12ecd387ee997b7b1955240021d975ab761 100644 --- a/src/php/Models/PHPClass.php +++ b/src/php/Models/PHPClass.php @@ -36,9 +36,6 @@ final class PHPClass implements ClassName /** * ClassName constructor. - * - * @param string $namespace - * @param string $baseName */ private function __construct(string $namespace, string $baseName) { @@ -48,8 +45,6 @@ final class PHPClass implements ClassName /** * Get namespace. - * - * @return string */ public function getNamespace(): string { @@ -58,17 +53,12 @@ final class PHPClass implements ClassName /** * Get baseName. - * - * @return string */ public function getBaseName(): string { return $this->baseName; } - /** - * @return string - */ public function getFullName(): string { return $this->namespace . $this->baseName; @@ -90,12 +80,6 @@ final class PHPClass implements ClassName return $this->getFullName(); } - /** - * @param PHPClass $a - * @param PHPClass $b - * - * @return bool - */ public static function baseNameOrdering(PHPClass $a, PHPClass $b): bool { return $a->getBaseName() > $b->getBaseName(); @@ -103,8 +87,6 @@ final class PHPClass implements ClassName /** * @param ClassName|\ReflectionClass|string $name - * - * @return ClassName */ public static function get($name): ClassName { diff --git a/src/php/Models/Types/AbstractCollection.php b/src/php/Models/Types/AbstractCollection.php index 5dec9a97b527538fc6ce3e507d92931e2342ba5d..14969ee60439935d93eb73d6a71e2eb58c7271da 100644 --- a/src/php/Models/Types/AbstractCollection.php +++ b/src/php/Models/Types/AbstractCollection.php @@ -33,17 +33,12 @@ abstract class AbstractCollection extends AbstractType /** * Collection constructor. - * - * @param Type $valueType */ public function __construct(Type $valueType) { $this->valueType = $valueType; } - /** - * @return Type - */ public function getValueType(): Type { return $this->valueType; @@ -74,14 +69,8 @@ abstract class AbstractCollection extends AbstractType return ['type' => $this->getGenericUsage(), 'keyType' => $this->getKeyType(), 'valueType' => $this->valueType]; } - /** - * @return Type - */ abstract protected function getKeyType(): Type; - /** - * @return string - */ abstract protected function getGenericUsage(): string; /** diff --git a/src/php/Models/Types/Alias.php b/src/php/Models/Types/Alias.php index e9c522722793a36c63f721a08b5c5c82025d7682..47eef1f68e22b99277955b574c7e475826772d64 100644 --- a/src/php/Models/Types/Alias.php +++ b/src/php/Models/Types/Alias.php @@ -37,10 +37,6 @@ final class Alias extends AbstractType implements Declaration /** * Alias constructor. - * - * @param string $name - * @param Type $target - * @param string $description */ public function __construct(string $name, Type $target, string $description = '') { diff --git a/src/php/Models/Types/ArrayType.php b/src/php/Models/Types/ArrayType.php index 7e0cea23ea872f6a199c16d035f7ad34055db4c3..4a7adc6972a3b3f2282175b6043c7d060cba8cb2 100644 --- a/src/php/Models/Types/ArrayType.php +++ b/src/php/Models/Types/ArrayType.php @@ -74,9 +74,6 @@ class ArrayType extends AbstractCollection ); } - /** - * @return string - */ private function getItemName(): string { $valueUsage = $this->getValueType()->getUsage(); diff --git a/src/php/Models/Types/BuiltinType.php b/src/php/Models/Types/BuiltinType.php index d6cef0d11826d23da0fd0b8f690670da8b3eee2d..1474da9df42ff2c1f249a01557dbf271980c7dc5 100644 --- a/src/php/Models/Types/BuiltinType.php +++ b/src/php/Models/Types/BuiltinType.php @@ -35,8 +35,6 @@ class BuiltinType extends AbstractType /** * BuiltinType constructor. - * - * @param string $name */ private function __construct(string $name) { diff --git a/src/php/Models/Types/Deferred.php b/src/php/Models/Types/Deferred.php index 264b0be5926cf02372970acc581e502c3eecaddd..7ba65f4552506be8e3da92dd6053271dcbe3c917 100644 --- a/src/php/Models/Types/Deferred.php +++ b/src/php/Models/Types/Deferred.php @@ -26,13 +26,7 @@ namespace Irstea\NgModelGeneratorBundle\Models\Types; */ interface Deferred extends Type { - /** - * @param callable $callback - */ public function resolveWith(callable $callback): Type; - /** - * @param Type $result - */ public function resolve(Type $result): Type; } diff --git a/src/php/Models/Types/Objects/AbstractHierarchicalObject.php b/src/php/Models/Types/Objects/AbstractHierarchicalObject.php index a9b607debd407eb5edd7590c83be0ebdba07bbab..fcb3e013ce0dd01b0ba18c50733f2020b0926c5a 100644 --- a/src/php/Models/Types/Objects/AbstractHierarchicalObject.php +++ b/src/php/Models/Types/Objects/AbstractHierarchicalObject.php @@ -44,11 +44,7 @@ abstract class AbstractHierarchicalObject extends AnonymousObject implements Dec /** * ObjectClass constructor. * - * @param string $name - * @param Type|null $parent * @param Property[] $properties - * @param string $description - * @param array $children */ public function __construct(string $name, ?Type $parent, array $properties = [], string $description = '', array $children = []) { @@ -83,9 +79,6 @@ abstract class AbstractHierarchicalObject extends AnonymousObject implements Dec return implode("\n", array_filter($parts)); } - /** - * @return string - */ protected function getComment(): string { return $this->description @@ -93,25 +86,16 @@ abstract class AbstractHierarchicalObject extends AnonymousObject implements Dec : ''; } - /** - * @return string - */ protected function getDecoratorDeclaration(): string { return ''; } - /** - * @return string - */ protected function getQualifierDeclaration(): string { return 'export'; } - /** - * @return string - */ protected function getInheritanceDeclaration(): string { return $this->parent ? sprintf('extends %s', $this->parent->getUsage()) : ''; @@ -129,8 +113,5 @@ abstract class AbstractHierarchicalObject extends AnonymousObject implements Dec yield from parent::getIterator(); } - /** - * @return string - */ abstract protected function getKind(): string; } diff --git a/src/php/Models/Types/Objects/AnonymousObject.php b/src/php/Models/Types/Objects/AnonymousObject.php index 9f94fe6567815f2bb2bffd3c6448d972464ba890..491074b7b5daa9b4b7afe987cb62787e47dc030e 100644 --- a/src/php/Models/Types/Objects/AnonymousObject.php +++ b/src/php/Models/Types/Objects/AnonymousObject.php @@ -61,11 +61,6 @@ class AnonymousObject extends AbstractType return $this->properties; } - /** - * @param string $name - * - * @return bool - */ public function hasProperty(string $name): bool { $props = $this->getProperties(); @@ -73,11 +68,6 @@ class AnonymousObject extends AbstractType return isset($props[$name]); } - /** - * @param string $name - * - * @return Property - */ public function getProperty(string $name): Property { $props = $this->getProperties(); @@ -129,17 +119,11 @@ class AnonymousObject extends AbstractType return trim(trim($this->getDeclarationHeader()) . ' ' . $this->getDeclarationBody(true)); } - /** - * @return string - */ protected function getDeclarationHeader(): string { return ''; } - /** - * @return string - */ private function getDeclarationBody(bool $multiline): string { $body = array_merge( @@ -154,9 +138,6 @@ class AnonymousObject extends AbstractType return '{ ' . implode(' ', $body) . ' }'; } - /** - * @return array - */ protected function getPropertyDeclarations(): array { return array_map( @@ -165,9 +146,6 @@ class AnonymousObject extends AbstractType ); } - /** - * @return array - */ protected function getMethodDeclarations(): array { return []; diff --git a/src/php/Models/Types/Objects/Property.php b/src/php/Models/Types/Objects/Property.php index efcf9c38c50d1e6fd31785c51f8bd0a9f794d895..3c8861c190aa00fb3ee2befa9e6f66ffd706bec7 100644 --- a/src/php/Models/Types/Objects/Property.php +++ b/src/php/Models/Types/Objects/Property.php @@ -49,14 +49,6 @@ class Property implements \IteratorAggregate, \JsonSerializable /** * Property constructor. - * - * @param string $name - * @param string $description - * @param Type $type - * @param bool $isIdentifier - * @param bool $isNullable - * @param bool $isReadonly - * @param string|null $originalName */ public function __construct( string $name, @@ -78,8 +70,6 @@ class Property implements \IteratorAggregate, \JsonSerializable /** * Get type. - * - * @return Type */ public function getType(): Type { @@ -88,8 +78,6 @@ class Property implements \IteratorAggregate, \JsonSerializable /** * Get description. - * - * @return string */ public function getDescription(): string { @@ -98,8 +86,6 @@ class Property implements \IteratorAggregate, \JsonSerializable /** * Get originalName. - * - * @return string */ public function getOriginalName(): string { @@ -108,8 +94,6 @@ class Property implements \IteratorAggregate, \JsonSerializable /** * Get isIdentifier. - * - * @return bool */ public function isIdentifier(): bool { @@ -118,8 +102,6 @@ class Property implements \IteratorAggregate, \JsonSerializable /** * Get isNullable. - * - * @return bool */ public function isNullable(): bool { @@ -128,8 +110,6 @@ class Property implements \IteratorAggregate, \JsonSerializable /** * Get isReadonly. - * - * @return bool */ public function isReadonly(): bool { @@ -150,11 +130,6 @@ class Property implements \IteratorAggregate, \JsonSerializable ); } - /** - * @param bool $usingOriginal - * - * @return string - */ public function getObjectKey(bool $usingOriginal = false): string { return TypescriptHelper::objectLiteralKey($this->doGetName($usingOriginal)); @@ -168,11 +143,6 @@ class Property implements \IteratorAggregate, \JsonSerializable return TypescriptHelper::propertyAccessor($varName, $this->doGetName($usingOriginal)); } - /** - * @param bool $usingOriginal - * - * @return string - */ private function doGetName(bool $usingOriginal = false): string { return $usingOriginal ? $this->originalName : $this->name; @@ -201,12 +171,6 @@ class Property implements \IteratorAggregate, \JsonSerializable ]; } - /** - * @param Property $a - * @param Property $b - * - * @return bool - */ public static function compare(Property $a, Property $b): bool { if ($a === $b) { @@ -226,10 +190,6 @@ class Property implements \IteratorAggregate, \JsonSerializable } /** - * @param string $name - * @param string $description - * @param Type $type - * * @return static */ public static function createIdentifier(string $name, string $description, Type $type) diff --git a/src/php/Models/Types/Objects/Repository.php b/src/php/Models/Types/Objects/Repository.php index 1c3038da5f337449b407fa31bbdd8f0969190931..14e8b810dd95deafb026d26b88d46156b67448c5 100644 --- a/src/php/Models/Types/Objects/Repository.php +++ b/src/php/Models/Types/Objects/Repository.php @@ -54,12 +54,7 @@ final class Repository extends ClassType /** * Repository constructor. * - * @param ClassName $resource - * @param Type $resourceType - * @param Property $identifier - * @param Path|null $iri * @param Operation[] $operations - * @param string $description */ public function __construct(ClassName $resource, Type $resourceType, Property $identifier, ?Path $iri, array $operations, string $description = '') { @@ -84,8 +79,6 @@ final class Repository extends ClassType /** * Get resourceName. - * - * @return string */ public function getResourceName(): string { @@ -94,8 +87,6 @@ final class Repository extends ClassType /** * Get resourceType. - * - * @return Type */ public function getResource(): Type { @@ -104,17 +95,12 @@ final class Repository extends ClassType /** * Get iri. - * - * @return Path|null */ public function getIRI(): ?Path { return $this->iri; } - /** - * @return Property - */ public function getIdentifier(): Property { return $this->identifier; @@ -146,12 +132,6 @@ final class Repository extends ClassType return $this->operations; } - /** - * @param self $a - * @param self $b - * - * @return bool - */ public static function compare(self $a, self $b): bool { return $a->getResourceName() > $b->getResourceName(); @@ -167,9 +147,6 @@ final class Repository extends ClassType yield from $this->operations; } - /** - * @return \Iterator - */ public function getAtTypes(): \Iterator { return IteratorBuilder::from($this->resourceType) diff --git a/src/php/Models/Types/Operations/Operation.php b/src/php/Models/Types/Operations/Operation.php index 1358727aded46c180e66d9a6e1f7b13c377f6186..9539e9c75d33669c6f63e5851d8c279b620d6c53 100644 --- a/src/php/Models/Types/Operations/Operation.php +++ b/src/php/Models/Types/Operations/Operation.php @@ -55,13 +55,8 @@ final class Operation implements \IteratorAggregate, \JsonSerializable /** * Operation constructor. * - * @param string $name * @param Parameter[] $parameters - * @param Path $path - * @param Type|null $returnType * @param string[] $body - * @param string $description - * @param array $relatedTypes */ public function __construct( string $name, @@ -103,8 +98,6 @@ final class Operation implements \IteratorAggregate, \JsonSerializable /** * Get returnType. - * - * @return Type */ public function getReturnType(): Type { @@ -121,9 +114,6 @@ final class Operation implements \IteratorAggregate, \JsonSerializable return $this->body; } - /** - * @return Representation|null - */ public function getResourceType(): ?Representation { $type = $this->returnType; diff --git a/src/php/Models/Types/Operations/Parameter.php b/src/php/Models/Types/Operations/Parameter.php index af43da1c63e09fd3795d97ebeae8735a4770c0fb..a74100f3a6a36dc25b89f144cbc7066688b00bc0 100644 --- a/src/php/Models/Types/Operations/Parameter.php +++ b/src/php/Models/Types/Operations/Parameter.php @@ -48,11 +48,6 @@ class Parameter implements \IteratorAggregate, \JsonSerializable /** * Parameter constructor. - * - * @param string $name - * @param Type $type - * @param bool $optional - * @param string|null $default */ public function __construct(string $name, Type $type, bool $optional = false, ?string $default = null) { @@ -64,8 +59,6 @@ class Parameter implements \IteratorAggregate, \JsonSerializable /** * Get type. - * - * @return Type */ public function getType(): Type { @@ -93,8 +86,6 @@ class Parameter implements \IteratorAggregate, \JsonSerializable /** * Get optional. - * - * @return bool */ public function isOptional(): bool { @@ -109,11 +100,6 @@ class Parameter implements \IteratorAggregate, \JsonSerializable yield $this->type; } - /** - * @param self $other - * - * @return bool - */ public function isEqual(self $other): bool { /* @noinspection TypeUnsafeComparisonInspection */ diff --git a/src/php/Models/Types/Operations/ParameterPathPart.php b/src/php/Models/Types/Operations/ParameterPathPart.php index 79a288de2d04a51d02e55fdd418064d00fe68df4..5c01f670c79e7fc916bcb4325b29c0dcee5eb83a 100644 --- a/src/php/Models/Types/Operations/ParameterPathPart.php +++ b/src/php/Models/Types/Operations/ParameterPathPart.php @@ -38,9 +38,6 @@ final class ParameterPathPart implements PathPart /** * ParameterPathPart constructor. - * - * @param Parameter $parameter - * @param string $requirement */ public function __construct(Parameter $parameter, string $requirement = '[^/]+') { diff --git a/src/php/Models/Types/Operations/Path.php b/src/php/Models/Types/Operations/Path.php index 1c5402519fd0a7b6bb9e6a98a474cb778097d185..84ce3404aaa2b8c7d475108fe9f5a6138c29a6c8 100644 --- a/src/php/Models/Types/Operations/Path.php +++ b/src/php/Models/Types/Operations/Path.php @@ -43,9 +43,6 @@ final class Path $this->parts = $parts; } - /** - * @return string - */ public function getUsage(): string { return TypescriptHelper::quoteString( @@ -54,9 +51,6 @@ final class Path ); } - /** - * @return string - */ public function getTemplate(): string { return implode( @@ -70,9 +64,6 @@ final class Path ); } - /** - * @return string - */ public function getTestPattern(): string { return implode( @@ -86,9 +77,6 @@ final class Path ); } - /** - * @return string - */ public function getCapturePattern(): string { return implode( @@ -102,9 +90,6 @@ final class Path ); } - /** - * @return bool - */ public function hasParameters(): bool { foreach ($this->parts as $part) { @@ -131,12 +116,6 @@ final class Path ); } - /** - * @param Path $other - * @param Parameter $otherParameter - * - * @return Path - */ public function buildUsing(Path $other, Parameter $otherParameter): Path { if (\count($other->parts) > \count($this->parts)) { diff --git a/src/php/Models/Types/Operations/PathPart.php b/src/php/Models/Types/Operations/PathPart.php index c6c087ecf87d5b25b495b288f38a1bcfda80a0d7..f1e79346f23589bf3475a17da98a13b871fa5233 100644 --- a/src/php/Models/Types/Operations/PathPart.php +++ b/src/php/Models/Types/Operations/PathPart.php @@ -26,30 +26,13 @@ namespace Irstea\NgModelGeneratorBundle\Models\Types\Operations; */ interface PathPart { - /** - * @return string - */ public function asTemplate(): string; - /** - * @return string - */ public function asTestPattern(): string; - /** - * @return string - */ public function asCapturePattern(): string; - /** - * @return Parameter|null - */ public function getParameter(): ?Parameter; - /** - * @param PathPart $other - * - * @return bool - */ public function isEqual(PathPart $other): bool; } diff --git a/src/php/Models/Types/Placeholder.php b/src/php/Models/Types/Placeholder.php index 5b304e0716240add5f9190d7a2da39f27d927d20..d23967dbb04923d9e99ee2dad010bff12e24de92 100644 --- a/src/php/Models/Types/Placeholder.php +++ b/src/php/Models/Types/Placeholder.php @@ -34,8 +34,6 @@ class Placeholder extends AbstractType /** * Placeholder constructor. - * - * @param string $name */ private function __construct(string $name) { diff --git a/src/php/Models/Types/Reference.php b/src/php/Models/Types/Reference.php index 04ddf53a7c770863f9c2b0b034efb28dccdca6c3..d4290513cdcb556d204f0bb76787140fec7e547e 100644 --- a/src/php/Models/Types/Reference.php +++ b/src/php/Models/Types/Reference.php @@ -41,8 +41,6 @@ class Reference extends AbstractType implements Deferred /** * Reference constructor. - * - * @param string $name */ public function __construct(string $name = 'anonymous reference') { @@ -52,8 +50,6 @@ class Reference extends AbstractType implements Deferred /** * Get target. - * - * @return Type */ public function getTarget(): Type { diff --git a/src/php/Models/Types/StringConst.php b/src/php/Models/Types/StringConst.php index 3be57474c94a090827140157b413519dc8cc9a19..d194fea990103d67d6af1b899997bc5f570afb6c 100644 --- a/src/php/Models/Types/StringConst.php +++ b/src/php/Models/Types/StringConst.php @@ -35,8 +35,6 @@ final class StringConst extends AbstractType /** * StringConst constructor. - * - * @param string $name */ private function __construct(string $name) { diff --git a/src/php/Models/Types/Type.php b/src/php/Models/Types/Type.php index aa30f14a29038bf9f481780dc73dd77d05c8e9d3..30de4bb69a8c4244f661c29e4be85845f3eefa81 100644 --- a/src/php/Models/Types/Type.php +++ b/src/php/Models/Types/Type.php @@ -26,37 +26,13 @@ namespace Irstea\NgModelGeneratorBundle\Models\Types; */ interface Type extends \IteratorAggregate, \JsonSerializable { - /** - * @return string - */ public function getUsage(): string; - /** - * @param string $expr - * - * @return string - */ public function castToStringOrStringArray(string $expr): string; - /** - * @param string $expr - * @param bool $explicit - * - * @return string - */ public function checkType(string $expr, bool $explicit = false): string; - /** - * @param string $typeClass - * - * @return Type - */ public function getAsType(string $typeClass): Type; - /** - * @param string $typeClass - * - * @return Type|null - */ public function findType(string $typeClass): ?Type; } diff --git a/src/php/Models/Types/Union.php b/src/php/Models/Types/Union.php index 94678c3bf04759595b98385ff0b6ed7e845e196b..106fef7450bc4ae2719e4311b9aa2be71cb1cdfb 100644 --- a/src/php/Models/Types/Union.php +++ b/src/php/Models/Types/Union.php @@ -33,8 +33,6 @@ final class Union extends AbstractType /** * Union constructor. - * - * @param array $types */ private function __construct(array $types = []) { @@ -103,8 +101,6 @@ final class Union extends AbstractType /** * @param Type[] $types - * - * @return Type */ public static function create(array $types): Type { diff --git a/src/php/Models/Types/Unresolved.php b/src/php/Models/Types/Unresolved.php index 89b4c0f3a8e7cefca19612ad9cb222f3f1cf1566..f9efcdf5539f20b05c89f6040a7c5230f4249821 100644 --- a/src/php/Models/Types/Unresolved.php +++ b/src/php/Models/Types/Unresolved.php @@ -107,9 +107,6 @@ final class Unresolved implements Type, HasName return $this->getUsage(); } - /** - * @return Unresolved - */ public static function get(): Unresolved { static $instance = null; diff --git a/src/php/OperationMapper.php b/src/php/OperationMapper.php index 936b696bea61ab66d126e922bbbee3398538200d..4758e8a9aa5c8461b3b684a8e6fbfaecf74a1bba 100644 --- a/src/php/OperationMapper.php +++ b/src/php/OperationMapper.php @@ -39,7 +39,6 @@ use Irstea\NgModelGeneratorBundle\Models\Types\Operations\Path; 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\Type; use Irstea\NgModelGeneratorBundle\Models\Types\Union; @@ -65,12 +64,6 @@ final class OperationMapper /** * OperationMapper constructor. - * - * @param TypeFactoryInterface $typeFactory - * @param SerializationMapperFactoryInterface $serializationMapperFactory - * @param PathParserInterface $pathParser - * @param OperationMetadata $operation - * @param Path|null $iri */ public function __construct( TypeFactoryInterface $typeFactory, @@ -86,9 +79,6 @@ final class OperationMapper $this->iri = $iri; } - /** - * @return Operation - */ public function __invoke(): Operation { $responseBody = null; @@ -185,13 +175,6 @@ final class OperationMapper return $mapper->get($serializationMetadata->getRoot()->getFullName()); } - /** - * @param array $callParameters - * @param Type $returnType - * @param string|null $iriParameterName - * - * @return string - */ private function buildClientCall(array $callParameters, Type $returnType, ?string $iriParameterName): string { $clientCall = sprintf( @@ -295,12 +278,6 @@ final class OperationMapper return $propDict; } - /** - * @param string $class - * @param string $property - * - * @return Type|null - */ private function resolvePropertyType(string $class, string $property): ?Type { /** @var AnonymousObject|null $type */ @@ -312,12 +289,6 @@ final class OperationMapper return $type->getProperty($property)->getType(); } - /** - * @param string $filterType - * @param Type $baseType - * - * @return Type - */ private function resolveFilterType(string $filterType, Type $baseType): Type { switch ($filterType) { @@ -339,11 +310,6 @@ final class OperationMapper return $baseType; } - /** - * @param Type $type - * - * @return Type - */ private function getSingularType(Type $type): Type { if ($type instanceof AbstractCollection) { @@ -358,9 +324,6 @@ final class OperationMapper /** * @param Property[] $filterProperties - * @param string $varName - * - * @return array */ private function buildFilterBody(array $filterProperties, string $varName): array { diff --git a/src/php/PathParserInterface.php b/src/php/PathParserInterface.php index d32e1871d3e43fab9c112c0bba3651748d383629..54fe19ae176dc7e7fb2f8582f4955379a7da5f47 100644 --- a/src/php/PathParserInterface.php +++ b/src/php/PathParserInterface.php @@ -28,11 +28,5 @@ use Irstea\NgModelGeneratorBundle\Models\Types\Operations\Path; */ interface PathParserInterface { - /** - * @param string $path - * @param array $requirements - * - * @return Path - */ public function parse(string $path, array $requirements): Path; } diff --git a/src/php/SerializationMapper.php b/src/php/SerializationMapper.php index 6252bd903a95cd305568f871da12ad98f60118da..1976153e77862d4210291c0b28b663f287223cc2 100644 --- a/src/php/SerializationMapper.php +++ b/src/php/SerializationMapper.php @@ -61,10 +61,6 @@ final class SerializationMapper implements TypeFactoryInterface /** * SerializationMapper constructor. - * - * @param TypeFactoryInterface $typeFactory - * @param SerializationMetadata $serialization - * @param bool $withAtFields */ public function __construct( TypeFactoryInterface $typeFactory, @@ -122,9 +118,6 @@ final class SerializationMapper implements TypeFactoryInterface return $this->typeFactory->get($name); } - /** - * @return array - */ public function getResourceData(): array { $resource = $this->serialization->getRoot(); @@ -145,11 +138,6 @@ final class SerializationMapper implements TypeFactoryInterface return [$this->get($resourceName), $identifier, $properties]; } - /** - * @param RepresentationMetadata $repr - * - * @return Type - */ private function mapRepresentation(RepresentationMetadata $repr): Type { $classInfo = $this->getClassInfo($repr); @@ -207,11 +195,6 @@ final class SerializationMapper implements TypeFactoryInterface return new Representation($repr, $repr->getName(), $parent, $properties, $desc, $children); } - /** - * @param array $resources - * - * @return IRI - */ private function createIRI(array $resources): IRI { return new IRI( @@ -224,11 +207,6 @@ final class SerializationMapper implements TypeFactoryInterface ); } - /** - * @param ClassInfo $classInfo - * - * @return array - */ private function mapProperties(ClassInfo $classInfo): array { $properties = []; @@ -245,13 +223,7 @@ final class SerializationMapper implements TypeFactoryInterface } if ($identifierCount > 1) { - throw new DomainException( - sprintf( - 'Resource %s must have at most one identifier, found %d', - $classInfo->getBaseName(), - $identifierCount - ) - ); + throw new DomainException(sprintf('Resource %s must have at most one identifier, found %d', $classInfo->getBaseName(), $identifierCount)); } if ($this->withAtFields && $classInfo->isResource()) { @@ -277,11 +249,6 @@ final class SerializationMapper implements TypeFactoryInterface return $properties; } - /** - * @param ClassInfo $classInfo - * - * @return Type - */ private function buildTypeEnumFor(ClassInfo $classInfo): Type { $types = []; @@ -292,11 +259,6 @@ final class SerializationMapper implements TypeFactoryInterface return Union::create($types); } - /** - * @param PropertyMetadata $propertyMeta - * - * @return Property - */ private function mapProperty(PropertyMetadata $propertyMeta): Property { return new Property( @@ -311,9 +273,6 @@ final class SerializationMapper implements TypeFactoryInterface /** * @param APIType $type - * @param bool $isLink - * - * @return Type */ private function mapType(?APIType $type, bool $isLink = false): Type { @@ -338,9 +297,6 @@ final class SerializationMapper implements TypeFactoryInterface /** * @param APIType $type - * @param bool $isLink - * - * @return Type */ private function mapCollection(?APIType $type, bool $isLink = false): Type { @@ -353,11 +309,6 @@ final class SerializationMapper implements TypeFactoryInterface throw new DomainException('Cannot handle collection with non-integer index'); } - /** - * @param ClassName $class - * - * @return ClassInfo - */ private function getClassInfo(ClassName $class): ClassInfo { if ($this->classInfo === null) { diff --git a/src/php/SerializationMapperFactory.php b/src/php/SerializationMapperFactory.php index d202d7aec9dc57c60708eb473fa4ee22492883d6..22cfb7c21bcb148f05e582cce96cb4a1bba8fe7f 100644 --- a/src/php/SerializationMapperFactory.php +++ b/src/php/SerializationMapperFactory.php @@ -36,20 +36,12 @@ final class SerializationMapperFactory implements SerializationMapperFactoryInte /** * SerializationMapperFactory constructor. - * - * @param TypeFactoryInterface $typeFactory */ public function __construct(TypeFactoryInterface $typeFactory) { $this->typeFactory = $typeFactory; } - /** - * @param SerializationMetadata $serialization - * @param bool $withAtFields - * - * @return SerializationMapper - */ public function create(SerializationMetadata $serialization, bool $withAtFields): SerializationMapper { $key = sprintf( diff --git a/src/php/SerializationMapperFactoryInterface.php b/src/php/SerializationMapperFactoryInterface.php index ba51673e5df5555da9448ad89027a96f53809d80..a992a3d60ae47c2f65ea81f8bbcfa89890053107 100644 --- a/src/php/SerializationMapperFactoryInterface.php +++ b/src/php/SerializationMapperFactoryInterface.php @@ -28,11 +28,5 @@ use Irstea\NgModelGeneratorBundle\Metadata\SerializationMetadata; */ interface SerializationMapperFactoryInterface { - /** - * @param SerializationMetadata $serialization - * @param bool $withAtFields - * - * @return SerializationMapper - */ public function create(SerializationMetadata $serialization, bool $withAtFields): SerializationMapper; } diff --git a/src/php/TypeFactory.php b/src/php/TypeFactory.php index b9e3e1fc00980f623f6a409314111751c302469e..fa3fea9bf2f2d61ced7865a9a7427e407e7e3592 100644 --- a/src/php/TypeFactory.php +++ b/src/php/TypeFactory.php @@ -43,21 +43,11 @@ final class TypeFactory implements TypeFactoryInterface, \IteratorAggregate yield from $this->types; } - /** - * @param string $name - * - * @return bool - */ public function has(string $name): bool { return isset($this->types[$name]); } - /** - * @param string $name - * - * @return Type - */ public function get(string $name): Type { // API-platform semble avoir un problème avec les types utilisés dans un Trait. diff --git a/src/php/TypeFactoryInterface.php b/src/php/TypeFactoryInterface.php index d87d88e7c494c6b565e04d30c099cb3853c14bea..981de94351a8556c7678de89eca6bf1e385dab33 100644 --- a/src/php/TypeFactoryInterface.php +++ b/src/php/TypeFactoryInterface.php @@ -29,30 +29,11 @@ use Irstea\NgModelGeneratorBundle\Models\Types\Type; */ interface TypeFactoryInterface { - /** - * @param string $name - * - * @return bool - */ public function has(string $name): bool; - /** - * @param string $name - * - * @return Type - */ public function get(string $name): Type; - /** - * @param string $name - * - * @return Deferred - */ public function defer(string $name): Deferred; - /** - * @param string $name - * @param Type $type - */ public function add(string $name, Type $type): void; } diff --git a/src/php/TypescriptHelper.php b/src/php/TypescriptHelper.php index 3f89a5ec9fe09dae91a4d289712c2e32f51a0b8d..b0a667fa0b018556453b797c07a8bdb3f8221966 100644 --- a/src/php/TypescriptHelper.php +++ b/src/php/TypescriptHelper.php @@ -28,10 +28,6 @@ final class TypescriptHelper { /** * Détermine si une chaîne est un identifiant valide. - * - * @param string $string - * - * @return bool */ public static function isValidIdentifier(string $string): bool { @@ -40,11 +36,6 @@ final class TypescriptHelper /** * Retourne une chaîne avec les échappements nécessaires. - * - * @param string $string - * @param string $delimiter - * - * @return string */ public static function quoteString(string $string, string $delimiter = "'"): string { @@ -63,10 +54,6 @@ final class TypescriptHelper /** * Retourne une chaîne pour déclarer une propriété dans un objet litéral. - * - * @param string $name - * - * @return string */ public static function objectLiteralKey(string $name): string { @@ -75,11 +62,6 @@ final class TypescriptHelper /** * Retourne une expression permettant de tester la présence d'une propriété dans un objet. - * - * @param string $object - * @param string $name - * - * @return string */ public static function propertyTestor(string $object, string $name): string { @@ -88,11 +70,6 @@ final class TypescriptHelper /** * Retourne une expression permettant d'accéder à une propriété dans un objet. - * - * @param string $object - * @param string $name - * - * @return string */ public static function propertyAccessor(string $object, string $name): string { @@ -105,11 +82,6 @@ final class TypescriptHelper /** * Indente un bloc de code. - * - * @param string $code - * @param string $indentation - * - * @return string */ public static function indent(string $code, string $indentation = ' '): string { diff --git a/src/php/Writers/ConsoleWriter.php b/src/php/Writers/ConsoleWriter.php index d66f27cc10ddf6287e4f08eb45f41bebef4f4c99..459163f572f065d1af41036b68727c327ecda604 100644 --- a/src/php/Writers/ConsoleWriter.php +++ b/src/php/Writers/ConsoleWriter.php @@ -21,7 +21,6 @@ namespace Irstea\NgModelGeneratorBundle\Writers; -use Symfony\Component\Console\Output\Output; use Symfony\Component\Console\Output\OutputInterface; /** @@ -37,8 +36,6 @@ final class ConsoleWriter implements Writer, MultiFileWriter /** * ConsoleWriter constructor. - * - * @param OutputInterface $output */ public function __construct(OutputInterface $output) { diff --git a/src/php/Writers/DirectoryWriter.php b/src/php/Writers/DirectoryWriter.php index 58f1c2e069adb31f7e550b88aaf7c8f4fdd8f1ac..8dcd992c9b6191a901696e0b1d69ec892c10cb64 100644 --- a/src/php/Writers/DirectoryWriter.php +++ b/src/php/Writers/DirectoryWriter.php @@ -33,8 +33,6 @@ final class DirectoryWriter implements MultiFileWriter /** * DirectoryWriter constructor. - * - * @param string $rootPath */ public function __construct(string $rootPath) { diff --git a/src/php/Writers/FilteringFileWriter.php b/src/php/Writers/FilteringFileWriter.php index a4cf1bbf141cc119fbe556511f54ec28efda4d88..27ea7de8780599405aa2c88b7c7ff5bd1b1b9156 100644 --- a/src/php/Writers/FilteringFileWriter.php +++ b/src/php/Writers/FilteringFileWriter.php @@ -38,9 +38,6 @@ final class FilteringFileWriter implements MultiFileWriter /** * FilteringFileWriter constructor. - * - * @param MultiFileWriter $writer - * @param callable $accept */ public function __construct(MultiFileWriter $writer, callable $accept) { diff --git a/src/php/Writers/MultiFileWriter.php b/src/php/Writers/MultiFileWriter.php index 6183f9de99b924ca8d86186fe69641f298ad4e3a..7d44a22421e722de23d6488b0299c23714c07fd6 100644 --- a/src/php/Writers/MultiFileWriter.php +++ b/src/php/Writers/MultiFileWriter.php @@ -26,11 +26,6 @@ namespace Irstea\NgModelGeneratorBundle\Writers; */ interface MultiFileWriter { - /** - * @param string $path - * - * @return Writer - */ public function newFile(string $path): Writer; public function close(): void; diff --git a/src/php/Writers/PhonyFileWriter.php b/src/php/Writers/PhonyFileWriter.php index 3d51c797b98f5558583a437610f8397ab6c35650..a4f39e89509da091f80428c44b25824d2481f0be 100644 --- a/src/php/Writers/PhonyFileWriter.php +++ b/src/php/Writers/PhonyFileWriter.php @@ -36,9 +36,6 @@ final class PhonyFileWriter implements MultiFileWriter /** * PhonyFileWriter constructor. - * - * @param MultiFileWriter $decorated - * @param OutputInterface $output */ public function __construct(MultiFileWriter $decorated, OutputInterface $output) { diff --git a/src/php/Writers/Writer.php b/src/php/Writers/Writer.php index 78b432ff68547aa4ef41054272da82fe6a880f46..b67712a98a3ff1ccc39a2803ea56ec962602cf0e 100644 --- a/src/php/Writers/Writer.php +++ b/src/php/Writers/Writer.php @@ -26,9 +26,6 @@ namespace Irstea\NgModelGeneratorBundle\Writers; */ interface Writer { - /** - * @param string $data - */ public function write(string $data): void; public function close(): void; diff --git a/src/php/Writers/ZipFileWriter.php b/src/php/Writers/ZipFileWriter.php index f60f492f0f95f4a51e8e7b65d5af9ac5c0b7d957..da42221f0355fd946f5b9ff5061927561759e563 100644 --- a/src/php/Writers/ZipFileWriter.php +++ b/src/php/Writers/ZipFileWriter.php @@ -37,9 +37,6 @@ final class ZipFileWriter implements Writer /** * ZipFileWriter constructor. - * - * @param \ZipArchive $archive - * @param string $path */ public function __construct(\ZipArchive $archive, string $path) { diff --git a/src/php/Writers/ZipWriter.php b/src/php/Writers/ZipWriter.php index 8bf9e1473864fe2fd9304030f02c80d9634a2310..ccf0c5364324c3b2b1f5cc91cb81846b05c4ae27 100644 --- a/src/php/Writers/ZipWriter.php +++ b/src/php/Writers/ZipWriter.php @@ -31,8 +31,6 @@ class ZipWriter implements MultiFileWriter /** * ZipWriter constructor. - * - * @param \ZipArchive $archive */ public function __construct(\ZipArchive $archive) { diff --git a/tests/Fixtures/Controller/CustomController.php b/tests/Fixtures/Controller/CustomController.php index fa71b8d920a1f3747029472ee6f4bd7bdec0d502..ea7b3a5d55f6935ea2104735453c1b6e5953b4e8 100644 --- a/tests/Fixtures/Controller/CustomController.php +++ b/tests/Fixtures/Controller/CustomController.php @@ -28,11 +28,6 @@ use Irstea\NgModelGeneratorBundle\Tests\Fixtures\Entity\EntityWithCustomMethods; */ final class CustomController { - /** - * @param EntityWithCustomMethods $input - * - * @return EntityWithCustomMethods - */ public function customItem(EntityWithCustomMethods $input): EntityWithCustomMethods { return new EntityWithCustomMethods(); diff --git a/tests/Fixtures/Entity/EntityWithAccessors.php b/tests/Fixtures/Entity/EntityWithAccessors.php index 4774ec44fb00cb0350455b130a8f0713fbb9d141..48ffb5e56d247b6e7e34f1fb8fe75c5cc500e390 100644 --- a/tests/Fixtures/Entity/EntityWithAccessors.php +++ b/tests/Fixtures/Entity/EntityWithAccessors.php @@ -65,10 +65,6 @@ class EntityWithAccessors /** * EntityWithAccessors constructor. - * - * @param string $initRead - * @param string $initOnly - * @param string $full */ public function __construct(string $initRead, string $initOnly, string $full) { @@ -81,8 +77,6 @@ class EntityWithAccessors /** * Get id. - * - * @return UuidInterface */ public function getId(): UuidInterface { @@ -91,8 +85,6 @@ class EntityWithAccessors /** * Get initRead. - * - * @return string */ public function getInitRead(): string { @@ -101,8 +93,6 @@ class EntityWithAccessors /** * Get readOnly. - * - * @return string */ public function getReadOnly(): string { @@ -111,8 +101,6 @@ class EntityWithAccessors /** * Get full. - * - * @return string */ public function getFull(): string { @@ -121,8 +109,6 @@ class EntityWithAccessors /** * Set full. - * - * @param string $full */ public function setFull(string $full): void { @@ -131,8 +117,6 @@ class EntityWithAccessors /** * Set writeOnly. - * - * @param string $writeOnly */ public function setWriteOnly(string $writeOnly): void { diff --git a/tests/Fixtures/Entity/EntityWithCustomMethods.php b/tests/Fixtures/Entity/EntityWithCustomMethods.php index 43c9c98ea42c2aeefd9727bf6b282f744cdbcc16..b7d5784cbc6fd5be541d85e0786a442c94c082bd 100644 --- a/tests/Fixtures/Entity/EntityWithCustomMethods.php +++ b/tests/Fixtures/Entity/EntityWithCustomMethods.php @@ -63,8 +63,6 @@ class EntityWithCustomMethods /** * Get id. - * - * @return UuidInterface */ public function getId(): UuidInterface { diff --git a/tests/Fixtures/Entity/EntityWithDTO.php b/tests/Fixtures/Entity/EntityWithDTO.php index a35effffb90680a7398ca7f61798433d061cbc79..aed6dd2791645a68c4f1b746a9ac08f648623e87 100644 --- a/tests/Fixtures/Entity/EntityWithDTO.php +++ b/tests/Fixtures/Entity/EntityWithDTO.php @@ -63,8 +63,6 @@ class EntityWithDTO /** * Get id. - * - * @return UuidInterface */ public function getId(): UuidInterface { diff --git a/tests/Fixtures/Entity/EntityWithNullable.php b/tests/Fixtures/Entity/EntityWithNullable.php index d205d272de0a7e799e2966b35747c7a6f2b9cec8..895dbfa653e257ef8a3d67c6990378c556dd9b04 100644 --- a/tests/Fixtures/Entity/EntityWithNullable.php +++ b/tests/Fixtures/Entity/EntityWithNullable.php @@ -62,11 +62,6 @@ class EntityWithNullable /** * EntityWithNullable constructor. * - * @param string|null $nullableString - * @param Person|null $nullableEntity - * @param Person|null $nullableEmbeddedEntity - * @param \DateTimeInterface|null $nullableDate - * * @throws \Exception */ public function __construct(?string $nullableString, ?Person $nullableEntity, ?Person $nullableEmbeddedEntity, ?\DateTimeInterface $nullableDate) @@ -80,8 +75,6 @@ class EntityWithNullable /** * Get id. - * - * @return UuidInterface */ public function getId(): UuidInterface { @@ -90,8 +83,6 @@ class EntityWithNullable /** * Get nullableString. - * - * @return string|null */ public function getNullableString(): ?string { @@ -100,8 +91,6 @@ class EntityWithNullable /** * Set nullableString. - * - * @param string|null $nullableString */ public function setNullableString(? string $nullableString): void { @@ -110,8 +99,6 @@ class EntityWithNullable /** * Get nullableEntity. - * - * @return Person|null */ public function getNullableEntity(): ?Person { @@ -120,8 +107,6 @@ class EntityWithNullable /** * Set nullableEntity. - * - * @param Person|null $nullableEntity */ public function setNullableEntity(? Person $nullableEntity): void { @@ -130,8 +115,6 @@ class EntityWithNullable /** * Get nullableEmbeddedEntity. - * - * @return Person|null */ public function getNullableEmbeddedEntity(): ?Person { @@ -140,8 +123,6 @@ class EntityWithNullable /** * Set nullableEmbeddedEntity. - * - * @param Person|null $nullableEmbeddedEntity */ public function setNullableEmbeddedEntity(? Person $nullableEmbeddedEntity): void { @@ -150,8 +131,6 @@ class EntityWithNullable /** * Get nullableDate. - * - * @return \DateTimeInterface|null */ public function getNullableDate(): ?\DateTimeInterface { @@ -160,8 +139,6 @@ class EntityWithNullable /** * Set nullableDate. - * - * @param \DateTimeInterface|null $nullableDate */ public function setNullableDate(? \DateTimeInterface $nullableDate): void { diff --git a/tests/Fixtures/Entity/Person.php b/tests/Fixtures/Entity/Person.php index 565b1ec02667d6357d41220b353d8c89d1606ad1..601f6f7c015f826f137d0f93c8f5e1bdefdb35c9 100644 --- a/tests/Fixtures/Entity/Person.php +++ b/tests/Fixtures/Entity/Person.php @@ -48,8 +48,6 @@ class Person /** * Person constructor. * - * @param string $name - * * @throws \Exception */ public function __construct(string $name) @@ -60,8 +58,6 @@ class Person /** * Get id. - * - * @return UuidInterface */ public function getId(): UuidInterface { @@ -70,8 +66,6 @@ class Person /** * Set id. - * - * @param UuidInterface $id */ public function setId(UuidInterface $id): void { @@ -80,8 +74,6 @@ class Person /** * Get name. - * - * @return string */ public function getName(): string { @@ -90,8 +82,6 @@ class Person /** * Set name. - * - * @param string $name */ public function setName(string $name): void { diff --git a/tests/Fixtures/Entity/Project.php b/tests/Fixtures/Entity/Project.php index 32f4f12e0b59ccb3793e36865ac879af7af8c715..370a3f836a6d3594e18cd32a31712cd246efb470 100644 --- a/tests/Fixtures/Entity/Project.php +++ b/tests/Fixtures/Entity/Project.php @@ -84,12 +84,6 @@ class Project /** * Project constructor. * - * @param string $name - * @param string $acronym - * @param \DateTimeInterface $startDate - * @param array $participants - * @param \DateTimeInterface|null $endDate - * * @throws \Exception */ public function __construct( @@ -109,8 +103,6 @@ class Project /** * Get id. - * - * @return UuidInterface */ public function getId(): UuidInterface { @@ -119,8 +111,6 @@ class Project /** * Get name. - * - * @return string */ public function getName(): string { @@ -129,8 +119,6 @@ class Project /** * Set name. - * - * @param string $name */ public function setName(string $name): void { @@ -139,8 +127,6 @@ class Project /** * Get acronym. - * - * @return string */ public function getAcronym(): string { @@ -149,8 +135,6 @@ class Project /** * Set acronym. - * - * @param string $acronym */ public function setAcronym(string $acronym): void { @@ -159,8 +143,6 @@ class Project /** * Get startDate. - * - * @return \DateTimeInterface */ public function getStartDate(): \DateTimeInterface { @@ -169,8 +151,6 @@ class Project /** * Set startDate. - * - * @param \DateTimeInterface $startDate */ public function setStartDate(\DateTimeInterface $startDate): void { @@ -179,8 +159,6 @@ class Project /** * Get endDate. - * - * @return \DateTimeInterface|null */ public function getEndDate(): ?\DateTimeInterface { @@ -189,8 +167,6 @@ class Project /** * Set endDate. - * - * @param \DateTimeInterface|null $endDate */ public function setEndDate(?\DateTimeInterface $endDate): void { @@ -199,8 +175,6 @@ class Project /** * Get participants. - * - * @return array */ public function getParticipants(): array { @@ -209,8 +183,6 @@ class Project /** * Set participants. - * - * @param array $participants */ public function setParticipants(array $participants): void { diff --git a/tests/Functional/AccessorTest.php b/tests/Functional/AccessorTest.php index c9f68403f6daaaa2351d83ca7248c229e3379435..d3f97bd4cb8d1907bbae406170b6e37e737672d6 100644 --- a/tests/Functional/AccessorTest.php +++ b/tests/Functional/AccessorTest.php @@ -27,7 +27,6 @@ namespace Irstea\NgModelGeneratorBundle\Tests\Functional; final class AccessorTest extends GenerationTestCase { /** - * @param string $snippet * @param string $code * * @test @@ -38,9 +37,6 @@ final class AccessorTest extends GenerationTestCase self::assertCodeContains($snippet, self::generateTypescript()); } - /** - * @return array - */ public function listExpectedSnippets(): array { return [ diff --git a/tests/Functional/CustomMethodTest.php b/tests/Functional/CustomMethodTest.php index 8fa75224a6ecd1150c0ea6517fd71192defec950..e0e2fa437b43bf6ccbac9540d8bde065dc9992b2 100644 --- a/tests/Functional/CustomMethodTest.php +++ b/tests/Functional/CustomMethodTest.php @@ -27,7 +27,6 @@ namespace Irstea\NgModelGeneratorBundle\Tests\Functional; final class CustomMethodTest extends GenerationTestCase { /** - * @param string $snippet * @param string $code * * @test @@ -38,9 +37,6 @@ final class CustomMethodTest extends GenerationTestCase self::assertCodeContains($snippet, self::generateTypescript()); } - /** - * @return array - */ public function listExpectedSnippets(): array { return [ diff --git a/tests/Functional/DTOTest.php b/tests/Functional/DTOTest.php index 46695609b6611201e5268c50ae7646523196806d..364f20ebd147e941b4ffdd50857248f34610ef0b 100644 --- a/tests/Functional/DTOTest.php +++ b/tests/Functional/DTOTest.php @@ -27,7 +27,6 @@ namespace Irstea\NgModelGeneratorBundle\Tests\Functional; final class DTOTest extends GenerationTestCase { /** - * @param string $snippet * @param string $code * * @test @@ -38,9 +37,6 @@ final class DTOTest extends GenerationTestCase self::assertCodeContains($snippet, self::generateTypescript()); } - /** - * @return array - */ public function listExpectedSnippets(): array { return [ diff --git a/tests/Functional/GenerationTestCase.php b/tests/Functional/GenerationTestCase.php index bba091687ffcaf14614be2202b59e5a0fa5e9bfe..655072c9891ae3f55d43f79ef5989a248de28edb 100644 --- a/tests/Functional/GenerationTestCase.php +++ b/tests/Functional/GenerationTestCase.php @@ -37,8 +37,6 @@ abstract class GenerationTestCase extends KernelTestCase /** * @throws \Exception - * - * @return string */ public static function generateTypescript(): string { @@ -66,10 +64,6 @@ abstract class GenerationTestCase extends KernelTestCase /** * Vérifie que $code contient $needle en ignorant les différences de whitespaces. - * - * @param string $needle - * @param string $code - * @param string $message */ protected static function assertCodeContains( string $needle, diff --git a/tests/Functional/IntegerIdentifierTest.php b/tests/Functional/IntegerIdentifierTest.php index 6937a66988441ee847c118abed09af19df77a611..b3aef9b7e5ef6f483e14a1296bba76ee9479501d 100644 --- a/tests/Functional/IntegerIdentifierTest.php +++ b/tests/Functional/IntegerIdentifierTest.php @@ -27,7 +27,6 @@ namespace Irstea\NgModelGeneratorBundle\Tests\Functional; final class IntegerIdentifierTest extends GenerationTestCase { /** - * @param string $snippet * @param string $code * * @test @@ -38,9 +37,6 @@ final class IntegerIdentifierTest extends GenerationTestCase self::assertCodeContains($snippet, self::generateTypescript()); } - /** - * @return array - */ public function listExpectedSnippets(): array { return [ diff --git a/tests/Functional/NullableTest.php b/tests/Functional/NullableTest.php index 647e11db93a9a7bec1c65ba39b91b9a5ffccfc43..dd3ab704d66404d34b35e0f69d843017e97a1f40 100644 --- a/tests/Functional/NullableTest.php +++ b/tests/Functional/NullableTest.php @@ -27,7 +27,6 @@ namespace Irstea\NgModelGeneratorBundle\Tests\Functional; final class NullableTest extends GenerationTestCase { /** - * @param string $snippet * @param string $code * * @test @@ -38,9 +37,6 @@ final class NullableTest extends GenerationTestCase self::assertCodeContains($snippet, self::generateTypescript()); } - /** - * @return array - */ public function listExpectedSnippets(): array { return [ diff --git a/tests/Functional/ProjectResourceTest.php b/tests/Functional/ProjectResourceTest.php index 6f22843374c3ef3ea2816c4557aa13ce06a596a8..9c2071ab06ff9e0ba7f0f538182a65edad5b8978 100644 --- a/tests/Functional/ProjectResourceTest.php +++ b/tests/Functional/ProjectResourceTest.php @@ -27,7 +27,6 @@ namespace Irstea\NgModelGeneratorBundle\Tests\Functional; final class ProjectResourceTest extends GenerationTestCase { /** - * @param string $snippet * @param string $code * * @test @@ -40,10 +39,6 @@ final class ProjectResourceTest extends GenerationTestCase /** * Vérifie que $code contient $needle en ignorant les différences de whitespaces. - * - * @param string $needle - * @param string $code - * @param string $message */ protected static function assertCodeContains( string $needle, @@ -56,8 +51,6 @@ final class ProjectResourceTest extends GenerationTestCase /** * Fournit la liste des snippets à vérifier. - * - * @return array */ public function listExpectedSnippets(): array { diff --git a/tests/Functional/RelationTest.php b/tests/Functional/RelationTest.php index 6a0631d57dd8f219e1cddbc6bbaaeedd429503aa..a2c0465689090abcc5095b668a7bf275c6454b8b 100644 --- a/tests/Functional/RelationTest.php +++ b/tests/Functional/RelationTest.php @@ -27,7 +27,6 @@ namespace Irstea\NgModelGeneratorBundle\Tests\Functional; final class RelationTest extends GenerationTestCase { /** - * @param string $snippet * @param string $code * * @test @@ -38,9 +37,6 @@ final class RelationTest extends GenerationTestCase self::assertCodeContains($snippet, self::generateTypescript()); } - /** - * @return array - */ public function listExpectedSnippets(): array { return [ diff --git a/tests/Iterators/IteratorBuilderTest.php b/tests/Iterators/IteratorBuilderTest.php index ad5aee9495f3845c99cb1669f06fc1e3c81b3915..2548703ada38c08b1a8a2c06ad34bc7ad7632c60 100644 --- a/tests/Iterators/IteratorBuilderTest.php +++ b/tests/Iterators/IteratorBuilderTest.php @@ -205,11 +205,6 @@ final class IteratorBuilderTest extends TestCase ); } - /** - * @param \Traversable $iter - * - * @return array - */ private static function toArray(\Traversable $iter): array { $ary = []; diff --git a/tests/Models/ClassInfoTest.php b/tests/Models/ClassInfoTest.php index 2fd16fd3970210fa2d7f590bfbb9999e26caaed6..94c1ddcc75aa658123e0e5e5da078f89e2d24e63 100644 --- a/tests/Models/ClassInfoTest.php +++ b/tests/Models/ClassInfoTest.php @@ -208,13 +208,6 @@ final class ClassInfoTest extends TestCase self::assertArrayKeys(['id', 'name'], $child1->getVirtualProperties()); } - /** - * @param string $className - * @param array $propertyNames - * @param bool $abstract - * - * @return ClassInfo - */ private function create(string $className, array $propertyNames = [], bool $abstract = false): ClassInfo { return new ClassInfo( @@ -234,7 +227,6 @@ final class ClassInfoTest extends TestCase /** * @param string[] $expected - * @param array $actual * @param string|null $message */ public static function assertArrayKeys(array $expected, array $actual): void diff --git a/tests/Models/PHPClassTest.php b/tests/Models/PHPClassTest.php index 0dc055734d8957d65e6d892f5c59fe2f4ca5c95d..00494e332afcfd1b349b95119ccfc76a9aac4179 100644 --- a/tests/Models/PHPClassTest.php +++ b/tests/Models/PHPClassTest.php @@ -41,9 +41,6 @@ class PHPClassTest extends TestCase self::assertEquals($expected, $class->getBaseName()); } - /** - * @return array - */ public function getBaseNameTestCases(): array { return [ @@ -65,9 +62,6 @@ class PHPClassTest extends TestCase self::assertEquals($expected, $class->getNamespace()); } - /** - * @return array - */ public function getNamespaceTestCases(): array { return [ @@ -89,9 +83,6 @@ class PHPClassTest extends TestCase self::assertEquals($fqcn, $class->getFullName()); } - /** - * @return array - */ public function getFullNameTestCases(): array { return [ diff --git a/tests/TypescriptHelperTest.php b/tests/TypescriptHelperTest.php index 814d7c28e32eb2062d897d61478655406c11b8d3..afd9985f18e475d868a1166eb653326dabe70d5c 100644 --- a/tests/TypescriptHelperTest.php +++ b/tests/TypescriptHelperTest.php @@ -30,9 +30,6 @@ use PHPUnit\Framework\TestCase; class TypescriptHelperTest extends TestCase { /** - * @param string $name - * @param bool $expected - * * @dataProvider identifierTestCases */ public function testIsValidIdentifier(string $name, bool $expected): void @@ -40,9 +37,6 @@ class TypescriptHelperTest extends TestCase self::assertEquals($expected, TypescriptHelper::isValidIdentifier($name)); } - /** - * @return array - */ public function identifierTestCases(): array { return [ @@ -57,10 +51,6 @@ class TypescriptHelperTest extends TestCase } /** - * @param string $string - * @param string $delimiter - * @param string $expected - * * @dataProvider quoteStringTestCases */ public function testQuoteString(string $string, string $delimiter, string $expected): void @@ -68,9 +58,6 @@ class TypescriptHelperTest extends TestCase self::assertEquals($expected, TypescriptHelper::quoteString($string, $delimiter)); } - /** - * @return array - */ public function quoteStringTestCases(): array { return [