diff --git a/src/Decorators/ConstructorWithPromotedPropertiesDecorator.php b/src/Decorators/ConstructorWithPromotedPropertiesDecorator.php index 61d3ded90aa362061b7bf9d3f2db123b5c532a94..f7ebaec3cae8bfe8eb2cf51b8320f8c07fc69e17 100644 --- a/src/Decorators/ConstructorWithPromotedPropertiesDecorator.php +++ b/src/Decorators/ConstructorWithPromotedPropertiesDecorator.php @@ -27,10 +27,9 @@ final class ConstructorWithPromotedPropertiesDecorator if ($type->requiresDocComment()) { $docCommentType = $type->getDocCommentType($namespace); $constructor->addComment(\sprintf( - '@param %s $%s%s', + '@param %s $%s', $docCommentType, $fieldName, - $type->hasComment() ? ' ' . $type->getComment($namespace) : '' )); } } diff --git a/src/Decorators/GettersDecorator.php b/src/Decorators/GettersDecorator.php index 27cd4aaf5d3127b9287b4d3281f0b1f136f71f98..d6502afe22083b511b2913510a82e17aaccc1e6f 100644 --- a/src/Decorators/GettersDecorator.php +++ b/src/Decorators/GettersDecorator.php @@ -35,9 +35,8 @@ final class GettersDecorator implements ClassDecorator $docCommentType = $type->getDocCommentType($namespace); $getter->addComment(\sprintf( - '@return %s%s', + '@return %s', $docCommentType, - $type->hasComment() ? ' ' . $type->getComment($namespace) : '' )); } } diff --git a/src/Decorators/InitializingConstructorDecorator.php b/src/Decorators/InitializingConstructorDecorator.php index 127f104d9fc2ccfa8e4d5d9818dbfdfda7178b1a..20fb00737d200642994532e4df659b7c2ae611c2 100644 --- a/src/Decorators/InitializingConstructorDecorator.php +++ b/src/Decorators/InitializingConstructorDecorator.php @@ -35,10 +35,9 @@ final class InitializingConstructorDecorator implements ClassDecorator $docCommentType = $type->getDocCommentType($namespace); $constructor->addComment(\sprintf( - '@param %s $%s%s', + '@param %s $%s', $docCommentType, $fieldName, - $type->hasComment() ? ' ' . $type->getComment($namespace) : '' )); } } diff --git a/src/Decorators/PropertiesDecorator.php b/src/Decorators/PropertiesDecorator.php index b1e58736b07136842187ca4768624597f9043b15..9c91cfe949b12751e07e1a85eb69c75b9a29cc12 100644 --- a/src/Decorators/PropertiesDecorator.php +++ b/src/Decorators/PropertiesDecorator.php @@ -25,9 +25,8 @@ final class PropertiesDecorator implements ClassDecorator if ($type->requiresDocComment()) { $property->addComment(\sprintf( - '@var %s%s', + '@var %s', $type->getDocCommentType($namespace), - $type->hasComment() ? ' ' . $type->getComment($namespace) : '' )); } } diff --git a/src/Decorators/SettersDecorator.php b/src/Decorators/SettersDecorator.php index 8b2ede63a7953a28b48efa303ecf1cf92715d917..d53293dd87c93580936a231a0725be72c4a9e8f9 100644 --- a/src/Decorators/SettersDecorator.php +++ b/src/Decorators/SettersDecorator.php @@ -42,9 +42,8 @@ final class SettersDecorator implements ClassDecorator $docCommentType = $type->getDocCommentType($namespace); $getter->addComment(\sprintf( - '@return %s%s', + '@return %s', $docCommentType, - $type->hasComment() ? ' ' . $type->getComment($namespace) : '' )); } } diff --git a/src/Definition/Types/ClassType.php b/src/Definition/Types/ClassType.php index 88a7788618cc6f7666bf055816a99b6a40a6ffdb..8251d207298ec6e5cfa7c74b0eebaecafab3bc8c 100644 --- a/src/Definition/Types/ClassType.php +++ b/src/Definition/Types/ClassType.php @@ -51,18 +51,6 @@ final class ClassType implements Type } - public function hasComment(): bool - { - return FALSE; - } - - - public function getComment(PhpNamespace $namespace): ?string - { - return NULL; - } - - public function requiresDocComment(): bool { return FALSE; diff --git a/src/Definition/Types/CollectionType.php b/src/Definition/Types/CollectionType.php index b13b77ef796289598af6d147e0862c8736cca16a..9e67cdd4ac23f6a392766468a970a9b713f57952 100644 --- a/src/Definition/Types/CollectionType.php +++ b/src/Definition/Types/CollectionType.php @@ -72,18 +72,6 @@ final class CollectionType implements CompositeType } - public function hasComment(): bool - { - return FALSE; - } - - - public function getComment(PhpNamespace $namespace): ?string - { - return NULL; - } - - /** * @return Type[] */ diff --git a/src/Definition/Types/GenericType.php b/src/Definition/Types/GenericType.php index 102212ef52a879c9ddedb9a792ce693f0cb23f7c..9c7917f16133dfabd56f6b92914ca33cb410a514 100644 --- a/src/Definition/Types/GenericType.php +++ b/src/Definition/Types/GenericType.php @@ -68,18 +68,6 @@ final class GenericType implements CompositeType } - public function hasComment(): bool - { - return FALSE; - } - - - public function getComment(PhpNamespace $namespace): ?string - { - return NULL; - } - - /** * @return Type[] */ diff --git a/src/Definition/Types/ListType.php b/src/Definition/Types/ListType.php index 7c50f3cfa2e0b4051f7d26ba5b353fcac67e68a3..73bb6b2a5e675ef0ebc8f86e3c2e09ec406b774c 100644 --- a/src/Definition/Types/ListType.php +++ b/src/Definition/Types/ListType.php @@ -35,16 +35,6 @@ final class ListType implements CompositeType return \sprintf('%s[]', $this->itemType->getDocCommentType($namespace)); } - public function hasComment(): bool - { - return false; - } - - public function getComment(PhpNamespace $namespace): ?string - { - return null; - } - public function getSubTypes(): array { return [$this->itemType]; diff --git a/src/Definition/Types/NonCheckedClassType.php b/src/Definition/Types/NonCheckedClassType.php index 46987c4f9f3b9ffbcc6b7ae6a135e53807b0ff6b..590347dddcdfeb3bc1c64fbcab6dbc38dee217b0 100644 --- a/src/Definition/Types/NonCheckedClassType.php +++ b/src/Definition/Types/NonCheckedClassType.php @@ -44,18 +44,6 @@ final class NonCheckedClassType implements Type } - public function hasComment(): bool - { - return FALSE; - } - - - public function getComment(PhpNamespace $namespace): ?string - { - return NULL; - } - - public function requiresDocComment(): bool { return FALSE; diff --git a/src/Definition/Types/NullableType.php b/src/Definition/Types/NullableType.php index 82afa081b3505a839fcd55f3a23c40f71e75d3af..c2108d5dd604837314d409fe58984c691e3d4266 100644 --- a/src/Definition/Types/NullableType.php +++ b/src/Definition/Types/NullableType.php @@ -50,18 +50,6 @@ final class NullableType implements CompositeType } - public function hasComment(): bool - { - return FALSE; - } - - - public function getComment(PhpNamespace $namespace): ?string - { - return NULL; - } - - /** * @return Type[] */ diff --git a/src/Definition/Types/SimpleType.php b/src/Definition/Types/SimpleType.php index 0026b16ccd754df32ba65c5569113bae18461aa7..5b14e3533bb223df1908c5b163bbcbcd06f4638a 100644 --- a/src/Definition/Types/SimpleType.php +++ b/src/Definition/Types/SimpleType.php @@ -109,16 +109,4 @@ final class SimpleType implements Type return $this->type; } - - public function hasComment(): bool - { - return FALSE; - } - - - public function getComment(PhpNamespace $namespace): ?string - { - return NULL; - } - } diff --git a/src/Definition/Types/Type.php b/src/Definition/Types/Type.php index 29bc63e55da1dbc6197a28f09fc8c0a0dc3d8d97..313b1eb2072fd5fcf4684d0ce9c27cca95078a0c 100644 --- a/src/Definition/Types/Type.php +++ b/src/Definition/Types/Type.php @@ -21,10 +21,4 @@ interface Type public function getDocCommentType(PhpNamespace $namespace): string; - - public function hasComment(): bool; - - - public function getComment(PhpNamespace $namespace): ?string; - } diff --git a/src/Definition/Types/UnionType.php b/src/Definition/Types/UnionType.php index 8977ee9a945a062e2cb2c61b6e7190e02cea7cf4..3dab56bbf8090721a67eae5b921f92153f4a02e6 100644 --- a/src/Definition/Types/UnionType.php +++ b/src/Definition/Types/UnionType.php @@ -62,16 +62,4 @@ final class UnionType implements CompositeType $this->subTypes, )); } - - - public function hasComment(): bool - { - return false; - } - - - public function getComment(PhpNamespace $namespace): ?string - { - return null; - } }