From 8665d0328ecd729b926a879de2b8acc75fb0c830 Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Sat, 26 Aug 2023 11:11:55 +0200 Subject: [PATCH] Remove ( and ) from docblocks --- src/Generator/Helper/Operation.php | 2 +- tests/app/etc/openapi-client-generator.state | 42 ++++++++++---------- tests/app/src/Client.php | 2 +- tests/app/src/ClientInterface.php | 2 +- tests/app/src/Operator/Pets/Create.php | 2 +- tests/app/src/Operator/Pets/ListListing.php | 2 +- tests/app/src/Operator/Pets/List_.php | 2 +- tests/app/src/Operator/ShowPetById.php | 2 +- tests/app/src/Router/Get.php | 2 +- tests/app/src/Router/Get/Pets.php | 2 +- tests/app/src/Router/Get/Three.php | 2 +- tests/app/src/Router/Get/Two.php | 2 +- tests/app/src/Router/List/Pets.php | 2 +- tests/app/src/Router/List/Two.php | 2 +- tests/app/src/Router/Post/Pets.php | 2 +- tests/app/src/Router/Post/Two.php | 2 +- 16 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/Generator/Helper/Operation.php b/src/Generator/Helper/Operation.php index b94cd3c..23d5860 100644 --- a/src/Generator/Helper/Operation.php +++ b/src/Generator/Helper/Operation.php @@ -226,6 +226,6 @@ public static function getDocBlockResultTypeFromOperation(Representation\Operati private static function convertObservableIntoIterable(string $string): string { - return str_replace('\\' . Observable::class, 'iterable', $string); + return str_replace(['\\' . Observable::class, '(', ' ', ')'], ['iterable', '', '', ''], $string); } } diff --git a/tests/app/etc/openapi-client-generator.state b/tests/app/etc/openapi-client-generator.state index 4c8bd4c..65efc34 100644 --- a/tests/app/etc/openapi-client-generator.state +++ b/tests/app/etc/openapi-client-generator.state @@ -8,7 +8,7 @@ }, { "name": ".\/tests\/app\/src\/\/Operator\/Pets\/List_.php", - "hash": "d5e06764de2e2b183370a5aaafb9f120" + "hash": "9af898ae1c57745103476d228faf3261" }, { "name": ".\/tests\/app\/tests\/\/Operation\/Pets\/List_Test.php", @@ -20,7 +20,7 @@ }, { "name": ".\/tests\/app\/src\/\/Operator\/Pets\/ListListing.php", - "hash": "e19f34c5c2a982fdbc3435c068378003" + "hash": "16970d4c645eadba4732fdd8934f25b4" }, { "name": ".\/tests\/app\/tests\/\/Operation\/Pets\/ListListingTest.php", @@ -32,7 +32,7 @@ }, { "name": ".\/tests\/app\/src\/\/Operator\/Pets\/Create.php", - "hash": "56cf9b77dda2463da01d56f272a54fcb" + "hash": "3f866397b2738683e38ae39d6f717f47" }, { "name": ".\/tests\/app\/tests\/\/Operation\/Pets\/CreateTest.php", @@ -92,7 +92,7 @@ }, { "name": ".\/tests\/app\/src\/\/Operator\/ShowPetById.php", - "hash": "d0f7ed4e44e0d4c854615a5f34aec9ae" + "hash": "ddef8f6d81cac7c2bbe9ead2c7bd8104" }, { "name": ".\/tests\/app\/tests\/\/Operation\/ShowPetByIdTest.php", @@ -200,23 +200,27 @@ }, { "name": ".\/tests\/app\/src\/\/ClientInterface.php", - "hash": "31a880377bfd1045c8073884486a7f11" + "hash": "f5f7ffaade2db728ec4154f595bea029" }, { "name": ".\/tests\/app\/src\/\/Client.php", - "hash": "ee4a2025a9354a33e9bb90bf8bc01f4b" + "hash": "811c28abdfeae2fa8b5c44e2f0e42a4c" }, { "name": ".\/tests\/app\/src\/\/Router\/Get\/Pets.php", - "hash": "51682197401f5f61739d1ae126d04e81" + "hash": "c505ca252ef7bf931eb0f7056e2d4f0e" }, { "name": ".\/tests\/app\/src\/\/Router\/Get\/PetsList.php", "hash": "789dd8b770f3725e3d00073322705e19" }, + { + "name": ".\/tests\/app\/src\/\/Router\/Get.php", + "hash": "e193b567440e231d095ee3377278b13a" + }, { "name": ".\/tests\/app\/src\/\/Router\/List\/Pets.php", - "hash": "b6c6f9ea32f2797e49f62da95b2aa273" + "hash": "535394d3e3340bc834b864755084b68a" }, { "name": ".\/tests\/app\/src\/\/Router\/List\/PetsList.php", @@ -224,19 +228,19 @@ }, { "name": ".\/tests\/app\/src\/\/Router\/Post\/Pets.php", - "hash": "4f12671bfe69bab76001414bef941837" + "hash": "a4820844a134a8d519c68d833e08af35" }, { "name": ".\/tests\/app\/src\/\/Router\/Get\/Two.php", - "hash": "b3dfb54492236d6acce0d855f5a9722c" + "hash": "cc97d308408aef5b7b2bfd083265b439" }, { "name": ".\/tests\/app\/src\/\/Router\/Get\/Three.php", - "hash": "010a712431902ce0cd62c76b442f3b2f" + "hash": "8ef12f1f7f74b65907477d8b480a606b" }, { "name": ".\/tests\/app\/src\/\/Router\/List\/Two.php", - "hash": "8c536f506e86e29020d73148d614efc2" + "hash": "bc74df181ba05c9ea5279a3b0e052812" }, { "name": ".\/tests\/app\/src\/\/Router\/List\/Three.php", @@ -244,7 +248,11 @@ }, { "name": ".\/tests\/app\/src\/\/Router\/Post\/Two.php", - "hash": "50181ba1cfdb8b707f8a7bb47b0811ea" + "hash": "0ef219a58238401c84256fdd8c73f12e" + }, + { + "name": ".\/tests\/app\/src\/\/Routers.php", + "hash": "981e3ed9c1d96ba38e608555aeb4681d" }, { "name": ".\/tests\/app\/src\/\/OperationsInterface.php", @@ -281,14 +289,6 @@ { "name": ".\/tests\/app\/src\/\/Hydrators.php", "hash": "6dbea9f466671e1b304df02d18b5d627" - }, - { - "name": ".\/tests\/app\/src\/\/Router\/Get.php", - "hash": "0c8b86bc66e7540692ee4266e1c2ea95" - }, - { - "name": ".\/tests\/app\/src\/\/Routers.php", - "hash": "981e3ed9c1d96ba38e608555aeb4681d" } ] }, diff --git a/tests/app/src/Client.php b/tests/app/src/Client.php index 539255d..33b3fb7 100644 --- a/tests/app/src/Client.php +++ b/tests/app/src/Client.php @@ -29,7 +29,7 @@ public function __construct(\ApiClients\Contracts\HTTP\Headers\AuthenticationInt } // phpcs:disable /** - * @return ($call is Operation\Pets\List_::OPERATION_MATCH ? iterable<(Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)> : ($call is Operation\Pets\ListListing::OPERATION_MATCH ? iterable<(Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)> : ($call is Operation\Pets\Create::OPERATION_MATCH ? array{code: int} : ($call is Operation\Pets\List_\Gatos::OPERATION_MATCH ? iterable : ($call is Operation\Pets\List_\GatosListing::OPERATION_MATCH ? iterable : ($call is Operation\Pets\Names::OPERATION_MATCH ? iterable : ($call is Operation\Pets\NamesListing::OPERATION_MATCH ? iterable : (Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish))))))))) + * @return ($call is Operation\Pets\List_::OPERATION_MATCH ? iterable : ($call is Operation\Pets\ListListing::OPERATION_MATCH ? iterable : ($call is Operation\Pets\Create::OPERATION_MATCH ? array{code:int} : ($call is Operation\Pets\List_\Gatos::OPERATION_MATCH ? iterable : ($call is Operation\Pets\List_\GatosListing::OPERATION_MATCH ? iterable : ($call is Operation\Pets\Names::OPERATION_MATCH ? iterable : ($call is Operation\Pets\NamesListing::OPERATION_MATCH ? iterable : Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish)))))))) */ // phpcs:enable public function call(string $call, array $params = array()) : iterable|\ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish diff --git a/tests/app/src/ClientInterface.php b/tests/app/src/ClientInterface.php index 360fb52..6748814 100644 --- a/tests/app/src/ClientInterface.php +++ b/tests/app/src/ClientInterface.php @@ -17,7 +17,7 @@ interface ClientInterface { // phpcs:disable /** - * @return ($call is Operation\Pets\List_::OPERATION_MATCH ? iterable<(Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)> : ($call is Operation\Pets\ListListing::OPERATION_MATCH ? iterable<(Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)> : ($call is Operation\Pets\Create::OPERATION_MATCH ? array{code: int} : ($call is Operation\Pets\List_\Gatos::OPERATION_MATCH ? iterable : ($call is Operation\Pets\List_\GatosListing::OPERATION_MATCH ? iterable : ($call is Operation\Pets\Names::OPERATION_MATCH ? iterable : ($call is Operation\Pets\NamesListing::OPERATION_MATCH ? iterable : (Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish))))))))) + * @return ($call is Operation\Pets\List_::OPERATION_MATCH ? iterable : ($call is Operation\Pets\ListListing::OPERATION_MATCH ? iterable : ($call is Operation\Pets\Create::OPERATION_MATCH ? array{code:int} : ($call is Operation\Pets\List_\Gatos::OPERATION_MATCH ? iterable : ($call is Operation\Pets\List_\GatosListing::OPERATION_MATCH ? iterable : ($call is Operation\Pets\Names::OPERATION_MATCH ? iterable : ($call is Operation\Pets\NamesListing::OPERATION_MATCH ? iterable : Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish)))))))) */ // phpcs:enable public function call(string $call, array $params = array()) : iterable|\ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish; diff --git a/tests/app/src/Operator/Pets/Create.php b/tests/app/src/Operator/Pets/Create.php index 58b8864..4988f13 100644 --- a/tests/app/src/Operator/Pets/Create.php +++ b/tests/app/src/Operator/Pets/Create.php @@ -23,7 +23,7 @@ public function __construct(private \React\Http\Browser $browser, private \ApiCl { } /** - * @return array{code: int} + * @return array{code:int} */ public function call(array $params) : array { diff --git a/tests/app/src/Operator/Pets/ListListing.php b/tests/app/src/Operator/Pets/ListListing.php index 76c50cf..018186f 100644 --- a/tests/app/src/Operator/Pets/ListListing.php +++ b/tests/app/src/Operator/Pets/ListListing.php @@ -23,7 +23,7 @@ public function __construct(private \React\Http\Browser $browser, private \ApiCl { } /** - * @return iterable<(Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)> + * @return iterable */ public function call(int $perPage = 30, int $page = 1) : iterable { diff --git a/tests/app/src/Operator/Pets/List_.php b/tests/app/src/Operator/Pets/List_.php index 1bc7930..6715bcb 100644 --- a/tests/app/src/Operator/Pets/List_.php +++ b/tests/app/src/Operator/Pets/List_.php @@ -23,7 +23,7 @@ public function __construct(private \React\Http\Browser $browser, private \ApiCl { } /** - * @return iterable<(Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)> + * @return iterable */ public function call(int $perPage = 30, int $page = 1) : iterable { diff --git a/tests/app/src/Operator/ShowPetById.php b/tests/app/src/Operator/ShowPetById.php index 7195e3f..aab8081 100644 --- a/tests/app/src/Operator/ShowPetById.php +++ b/tests/app/src/Operator/ShowPetById.php @@ -23,7 +23,7 @@ public function __construct(private \React\Http\Browser $browser, private \ApiCl { } /** - * @return (Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish) + * @return Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish */ public function call() : \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|array { diff --git a/tests/app/src/Router/Get.php b/tests/app/src/Router/Get.php index 85b549c..32a77b6 100644 --- a/tests/app/src/Router/Get.php +++ b/tests/app/src/Router/Get.php @@ -19,7 +19,7 @@ public function __construct(private \League\OpenAPIValidation\Schema\SchemaValid { } /** - * @return (Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish) + * @return Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish */ public function showPetById(array $params) : \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|array { diff --git a/tests/app/src/Router/Get/Pets.php b/tests/app/src/Router/Get/Pets.php index 6402d89..d5d5c06 100644 --- a/tests/app/src/Router/Get/Pets.php +++ b/tests/app/src/Router/Get/Pets.php @@ -19,7 +19,7 @@ public function __construct(private \League\OpenAPIValidation\Schema\SchemaValid { } /** - * @return iterable<(Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)> + * @return iterable */ public function list(array $params) : iterable { diff --git a/tests/app/src/Router/Get/Three.php b/tests/app/src/Router/Get/Three.php index 73e4f12..d7e935e 100644 --- a/tests/app/src/Router/Get/Three.php +++ b/tests/app/src/Router/Get/Three.php @@ -19,7 +19,7 @@ public function __construct(private \ApiClients\Client\PetStore\Routers $routers { } /** - * @return iterable|iterable|(Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish) + * @return iterable|iterable|Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish */ public function call(string $call, array $params, array $pathChunks) : iterable|\ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish { diff --git a/tests/app/src/Router/Get/Two.php b/tests/app/src/Router/Get/Two.php index b4efde2..3f738a9 100644 --- a/tests/app/src/Router/Get/Two.php +++ b/tests/app/src/Router/Get/Two.php @@ -19,7 +19,7 @@ public function __construct(private \ApiClients\Client\PetStore\Routers $routers { } /** - * @return iterable<(Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish)> + * @return iterable */ public function call(string $call, array $params, array $pathChunks) : iterable { diff --git a/tests/app/src/Router/List/Pets.php b/tests/app/src/Router/List/Pets.php index be563ae..46b60ef 100644 --- a/tests/app/src/Router/List/Pets.php +++ b/tests/app/src/Router/List/Pets.php @@ -19,7 +19,7 @@ public function __construct(private \League\OpenAPIValidation\Schema\SchemaValid { } /** - * @return iterable<(Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)> + * @return iterable */ public function listListing(array $params) : iterable { diff --git a/tests/app/src/Router/List/Two.php b/tests/app/src/Router/List/Two.php index efa59ab..dddda5f 100644 --- a/tests/app/src/Router/List/Two.php +++ b/tests/app/src/Router/List/Two.php @@ -19,7 +19,7 @@ public function __construct(private \ApiClients\Client\PetStore\Routers $routers { } /** - * @return iterable<(Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish)> + * @return iterable */ public function call(string $call, array $params, array $pathChunks) : iterable { diff --git a/tests/app/src/Router/Post/Pets.php b/tests/app/src/Router/Post/Pets.php index aeab8bb..18b6c1b 100644 --- a/tests/app/src/Router/Post/Pets.php +++ b/tests/app/src/Router/Post/Pets.php @@ -19,7 +19,7 @@ public function __construct(private \League\OpenAPIValidation\Schema\SchemaValid { } /** - * @return array{code: int} + * @return array{code:int} */ public function create(array $params) : array { diff --git a/tests/app/src/Router/Post/Two.php b/tests/app/src/Router/Post/Two.php index e8e90a7..07e8468 100644 --- a/tests/app/src/Router/Post/Two.php +++ b/tests/app/src/Router/Post/Two.php @@ -19,7 +19,7 @@ public function __construct(private \ApiClients\Client\PetStore\Routers $routers { } /** - * @return array{code: int} + * @return array{code:int} */ public function call(string $call, array $params, array $pathChunks) : array {