diff --git a/src/Phpro/SoapClient/CodeGenerator/Assembler/IteratorAssembler.php b/src/Phpro/SoapClient/CodeGenerator/Assembler/IteratorAssembler.php index 8a2e4b6a..dd0ee458 100644 --- a/src/Phpro/SoapClient/CodeGenerator/Assembler/IteratorAssembler.php +++ b/src/Phpro/SoapClient/CodeGenerator/Assembler/IteratorAssembler.php @@ -71,6 +71,7 @@ private function implementGetIterator(ClassGenerator $class, Property $firstProp 'return new \\ArrayIterator(is_array($this->%1$s) ? $this->%1$s : []);', $firstProperty->getName() ), + 'returntype' => 'ArrayIterator', 'docblock' => DocBlockGeneratorFactory::fromArray([ 'tags' => [ [ diff --git a/src/Phpro/SoapClient/CodeGenerator/Assembler/JsonSerializableAssembler.php b/src/Phpro/SoapClient/CodeGenerator/Assembler/JsonSerializableAssembler.php index 3bd59dda..c3ac8f0d 100644 --- a/src/Phpro/SoapClient/CodeGenerator/Assembler/JsonSerializableAssembler.php +++ b/src/Phpro/SoapClient/CodeGenerator/Assembler/JsonSerializableAssembler.php @@ -6,7 +6,6 @@ use Phpro\SoapClient\CodeGenerator\Context\ContextInterface; use Phpro\SoapClient\CodeGenerator\Context\TypeContext; use Phpro\SoapClient\CodeGenerator\Model\Type; -use Phpro\SoapClient\CodeGenerator\LaminasCodeFactory\DocBlockGeneratorFactory; use Phpro\SoapClient\Exception\AssemblerException; use Laminas\Code\Generator\ClassGenerator; use Laminas\Code\Generator\MethodGenerator; @@ -61,14 +60,7 @@ private function implementJsonSerialize(Type $type, ClassGenerator $class) 'parameters' => [], 'visibility' => MethodGenerator::VISIBILITY_PUBLIC, 'body' => $this->generateJsonSerializeBody($type, $class), - 'docblock' => DocBlockGeneratorFactory::fromArray([ - 'tags' => [ - [ - 'name' => 'return', - 'description' => 'array' - ] - ] - ]) + 'returntype' => 'array', ]) ); } diff --git a/test/PhproTest/SoapClient/Unit/CodeGenerator/Assembler/IteratorAssemblerTest.php b/test/PhproTest/SoapClient/Unit/CodeGenerator/Assembler/IteratorAssemblerTest.php index df58a622..a5192d02 100644 --- a/test/PhproTest/SoapClient/Unit/CodeGenerator/Assembler/IteratorAssemblerTest.php +++ b/test/PhproTest/SoapClient/Unit/CodeGenerator/Assembler/IteratorAssemblerTest.php @@ -63,7 +63,7 @@ class MyType implements IteratorAggregate * @phpstan-return \ArrayIterator * @psalm-return \ArrayIterator */ - public function getIterator() + public function getIterator() : \ArrayIterator { return new \ArrayIterator(is_array(\$this->prop1) ? \$this->prop1 : []); } diff --git a/test/PhproTest/SoapClient/Unit/CodeGenerator/Assembler/JsonSerializableAssemblerTest.php b/test/PhproTest/SoapClient/Unit/CodeGenerator/Assembler/JsonSerializableAssemblerTest.php index 95e5f747..37e28f49 100644 --- a/test/PhproTest/SoapClient/Unit/CodeGenerator/Assembler/JsonSerializableAssemblerTest.php +++ b/test/PhproTest/SoapClient/Unit/CodeGenerator/Assembler/JsonSerializableAssemblerTest.php @@ -54,10 +54,7 @@ function it_assembles_a_type() class MyType implements JsonSerializable { - /** - * @return array - */ - public function jsonSerialize() + public function jsonSerialize() : array { return [ 'prop1' => \$this->prop1,