From b36226f587a1b710f610bb7111655bcb70db7520 Mon Sep 17 00:00:00 2001 From: DimanKuskov Date: Sun, 26 Jan 2020 13:53:20 +0300 Subject: [PATCH] Fixed minor fatal errors (#16) * Added missing public declarations * Minor fix * Added ArrayDenormalizer for correct body handling --- src/CodeGenerator/Dto/PhpParserRootDtoFactory.php | 3 +++ src/Resources/config/services.xml | 2 ++ src/Serializer/ReflectionDtoSerializer.php | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/CodeGenerator/Dto/PhpParserRootDtoFactory.php b/src/CodeGenerator/Dto/PhpParserRootDtoFactory.php index c9d3c53..e550779 100644 --- a/src/CodeGenerator/Dto/PhpParserRootDtoFactory.php +++ b/src/CodeGenerator/Dto/PhpParserRootDtoFactory.php @@ -91,6 +91,7 @@ public function generateRootDto( $this ->factory ->method('getPathParameters') + ->makePublic() ->setReturnType($pathParametersDtoClassName) ->addStmt(new Return_(new Variable('this->pathParameters'))) ); @@ -120,6 +121,7 @@ public function generateRootDto( $this ->factory ->method('getQueryParameters') + ->makePublic() ->setReturnType($queryParametersDtoClassName) ->addStmt(new Return_(new Variable('this->queryParameters'))) ); @@ -138,6 +140,7 @@ public function generateRootDto( $this ->factory ->method('getBody') + ->makePublic() ->setReturnType($requestBodyDtoClassName) ->addStmt(new Return_(new Variable('this->body'))) ); diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml index d8e0e0e..17a0dee 100644 --- a/src/Resources/config/services.xml +++ b/src/Resources/config/services.xml @@ -39,11 +39,13 @@ + + diff --git a/src/Serializer/ReflectionDtoSerializer.php b/src/Serializer/ReflectionDtoSerializer.php index 01ac335..b273fc3 100644 --- a/src/Serializer/ReflectionDtoSerializer.php +++ b/src/Serializer/ReflectionDtoSerializer.php @@ -119,7 +119,7 @@ private function setRequestBody(object $inputDto, ReflectionClass $inputDtoRefl, ); } - private function getInputDtoFQCN(string $serviceInterface, string $methodName) : string + private function getInputDtoFQCN(string $serviceInterface, string $methodName) : ?string { $interfaceReflectionClass = new ReflectionClass($serviceInterface); $method = $interfaceReflectionClass->getMethod($methodName);