Skip to content

Commit 2fb655b

Browse files
authored
Merge pull request #199 from php-api-clients/remove-(-and-)-from-docblocks
Remove ( and ) from docblocks
2 parents 471c867 + 8665d03 commit 2fb655b

File tree

16 files changed

+36
-36
lines changed

16 files changed

+36
-36
lines changed

src/Generator/Helper/Operation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,6 @@ public static function getDocBlockResultTypeFromOperation(Representation\Operati
226226

227227
private static function convertObservableIntoIterable(string $string): string
228228
{
229-
return str_replace('\\' . Observable::class, 'iterable', $string);
229+
return str_replace(['\\' . Observable::class, '(', ' ', ')'], ['iterable', '', '', ''], $string);
230230
}
231231
}

tests/app/etc/openapi-client-generator.state

+21-21
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
{
1010
"name": ".\/tests\/app\/src\/\/Operator\/Pets\/List_.php",
11-
"hash": "d5e06764de2e2b183370a5aaafb9f120"
11+
"hash": "9af898ae1c57745103476d228faf3261"
1212
},
1313
{
1414
"name": ".\/tests\/app\/tests\/\/Operation\/Pets\/List_Test.php",
@@ -20,7 +20,7 @@
2020
},
2121
{
2222
"name": ".\/tests\/app\/src\/\/Operator\/Pets\/ListListing.php",
23-
"hash": "e19f34c5c2a982fdbc3435c068378003"
23+
"hash": "16970d4c645eadba4732fdd8934f25b4"
2424
},
2525
{
2626
"name": ".\/tests\/app\/tests\/\/Operation\/Pets\/ListListingTest.php",
@@ -32,7 +32,7 @@
3232
},
3333
{
3434
"name": ".\/tests\/app\/src\/\/Operator\/Pets\/Create.php",
35-
"hash": "56cf9b77dda2463da01d56f272a54fcb"
35+
"hash": "3f866397b2738683e38ae39d6f717f47"
3636
},
3737
{
3838
"name": ".\/tests\/app\/tests\/\/Operation\/Pets\/CreateTest.php",
@@ -92,7 +92,7 @@
9292
},
9393
{
9494
"name": ".\/tests\/app\/src\/\/Operator\/ShowPetById.php",
95-
"hash": "d0f7ed4e44e0d4c854615a5f34aec9ae"
95+
"hash": "ddef8f6d81cac7c2bbe9ead2c7bd8104"
9696
},
9797
{
9898
"name": ".\/tests\/app\/tests\/\/Operation\/ShowPetByIdTest.php",
@@ -200,51 +200,59 @@
200200
},
201201
{
202202
"name": ".\/tests\/app\/src\/\/ClientInterface.php",
203-
"hash": "31a880377bfd1045c8073884486a7f11"
203+
"hash": "f5f7ffaade2db728ec4154f595bea029"
204204
},
205205
{
206206
"name": ".\/tests\/app\/src\/\/Client.php",
207-
"hash": "ee4a2025a9354a33e9bb90bf8bc01f4b"
207+
"hash": "811c28abdfeae2fa8b5c44e2f0e42a4c"
208208
},
209209
{
210210
"name": ".\/tests\/app\/src\/\/Router\/Get\/Pets.php",
211-
"hash": "51682197401f5f61739d1ae126d04e81"
211+
"hash": "c505ca252ef7bf931eb0f7056e2d4f0e"
212212
},
213213
{
214214
"name": ".\/tests\/app\/src\/\/Router\/Get\/PetsList.php",
215215
"hash": "789dd8b770f3725e3d00073322705e19"
216216
},
217+
{
218+
"name": ".\/tests\/app\/src\/\/Router\/Get.php",
219+
"hash": "e193b567440e231d095ee3377278b13a"
220+
},
217221
{
218222
"name": ".\/tests\/app\/src\/\/Router\/List\/Pets.php",
219-
"hash": "b6c6f9ea32f2797e49f62da95b2aa273"
223+
"hash": "535394d3e3340bc834b864755084b68a"
220224
},
221225
{
222226
"name": ".\/tests\/app\/src\/\/Router\/List\/PetsList.php",
223227
"hash": "ba00aad83ddbfccd10c10038ca0ecebd"
224228
},
225229
{
226230
"name": ".\/tests\/app\/src\/\/Router\/Post\/Pets.php",
227-
"hash": "4f12671bfe69bab76001414bef941837"
231+
"hash": "a4820844a134a8d519c68d833e08af35"
228232
},
229233
{
230234
"name": ".\/tests\/app\/src\/\/Router\/Get\/Two.php",
231-
"hash": "b3dfb54492236d6acce0d855f5a9722c"
235+
"hash": "cc97d308408aef5b7b2bfd083265b439"
232236
},
233237
{
234238
"name": ".\/tests\/app\/src\/\/Router\/Get\/Three.php",
235-
"hash": "010a712431902ce0cd62c76b442f3b2f"
239+
"hash": "8ef12f1f7f74b65907477d8b480a606b"
236240
},
237241
{
238242
"name": ".\/tests\/app\/src\/\/Router\/List\/Two.php",
239-
"hash": "8c536f506e86e29020d73148d614efc2"
243+
"hash": "bc74df181ba05c9ea5279a3b0e052812"
240244
},
241245
{
242246
"name": ".\/tests\/app\/src\/\/Router\/List\/Three.php",
243247
"hash": "ed2f78d6ad9c8fde60c41578f5c3e85f"
244248
},
245249
{
246250
"name": ".\/tests\/app\/src\/\/Router\/Post\/Two.php",
247-
"hash": "50181ba1cfdb8b707f8a7bb47b0811ea"
251+
"hash": "0ef219a58238401c84256fdd8c73f12e"
252+
},
253+
{
254+
"name": ".\/tests\/app\/src\/\/Routers.php",
255+
"hash": "981e3ed9c1d96ba38e608555aeb4681d"
248256
},
249257
{
250258
"name": ".\/tests\/app\/src\/\/OperationsInterface.php",
@@ -281,14 +289,6 @@
281289
{
282290
"name": ".\/tests\/app\/src\/\/Hydrators.php",
283291
"hash": "6dbea9f466671e1b304df02d18b5d627"
284-
},
285-
{
286-
"name": ".\/tests\/app\/src\/\/Router\/Get.php",
287-
"hash": "0c8b86bc66e7540692ee4266e1c2ea95"
288-
},
289-
{
290-
"name": ".\/tests\/app\/src\/\/Routers.php",
291-
"hash": "981e3ed9c1d96ba38e608555aeb4681d"
292292
}
293293
]
294294
},

tests/app/src/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(\ApiClients\Contracts\HTTP\Headers\AuthenticationInt
2929
}
3030
// phpcs:disable
3131
/**
32-
* @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<Schema\Cat> : ($call is Operation\Pets\List_\GatosListing::OPERATION_MATCH ? iterable<Schema\Cat> : ($call is Operation\Pets\Names::OPERATION_MATCH ? iterable<string> : ($call is Operation\Pets\NamesListing::OPERATION_MATCH ? iterable<string> : (Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)))))))))
32+
* @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<Schema\Cat> : ($call is Operation\Pets\List_\GatosListing::OPERATION_MATCH ? iterable<Schema\Cat> : ($call is Operation\Pets\Names::OPERATION_MATCH ? iterable<string> : ($call is Operation\Pets\NamesListing::OPERATION_MATCH ? iterable<string> : Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish))))))))
3333
*/
3434
// phpcs:enable
3535
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

tests/app/src/ClientInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface ClientInterface
1717
{
1818
// phpcs:disable
1919
/**
20-
* @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<Schema\Cat> : ($call is Operation\Pets\List_\GatosListing::OPERATION_MATCH ? iterable<Schema\Cat> : ($call is Operation\Pets\Names::OPERATION_MATCH ? iterable<string> : ($call is Operation\Pets\NamesListing::OPERATION_MATCH ? iterable<string> : (Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)))))))))
20+
* @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<Schema\Cat> : ($call is Operation\Pets\List_\GatosListing::OPERATION_MATCH ? iterable<Schema\Cat> : ($call is Operation\Pets\Names::OPERATION_MATCH ? iterable<string> : ($call is Operation\Pets\NamesListing::OPERATION_MATCH ? iterable<string> : Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish))))))))
2121
*/
2222
// phpcs:enable
2323
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;

tests/app/src/Operator/Pets/Create.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(private \React\Http\Browser $browser, private \ApiCl
2323
{
2424
}
2525
/**
26-
* @return array{code: int}
26+
* @return array{code:int}
2727
*/
2828
public function call(array $params) : array
2929
{

tests/app/src/Operator/Pets/ListListing.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(private \React\Http\Browser $browser, private \ApiCl
2323
{
2424
}
2525
/**
26-
* @return iterable<(Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)>
26+
* @return iterable<Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish>
2727
*/
2828
public function call(int $perPage = 30, int $page = 1) : iterable
2929
{

tests/app/src/Operator/Pets/List_.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(private \React\Http\Browser $browser, private \ApiCl
2323
{
2424
}
2525
/**
26-
* @return iterable<(Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)>
26+
* @return iterable<Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish>
2727
*/
2828
public function call(int $perPage = 30, int $page = 1) : iterable
2929
{

tests/app/src/Operator/ShowPetById.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(private \React\Http\Browser $browser, private \ApiCl
2323
{
2424
}
2525
/**
26-
* @return (Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)
26+
* @return Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish
2727
*/
2828
public function call() : \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|array
2929
{

tests/app/src/Router/Get.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(private \League\OpenAPIValidation\Schema\SchemaValid
1919
{
2020
}
2121
/**
22-
* @return (Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)
22+
* @return Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish
2323
*/
2424
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
2525
{

tests/app/src/Router/Get/Pets.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(private \League\OpenAPIValidation\Schema\SchemaValid
1919
{
2020
}
2121
/**
22-
* @return iterable<(Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)>
22+
* @return iterable<Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish>
2323
*/
2424
public function list(array $params) : iterable
2525
{

tests/app/src/Router/Get/Three.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(private \ApiClients\Client\PetStore\Routers $routers
1919
{
2020
}
2121
/**
22-
* @return iterable<Schema\Cat>|iterable<string>|(Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish)
22+
* @return iterable<Schema\Cat>|iterable<string>|Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish
2323
*/
2424
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
2525
{

tests/app/src/Router/Get/Two.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(private \ApiClients\Client\PetStore\Routers $routers
1919
{
2020
}
2121
/**
22-
* @return iterable<(Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish)>
22+
* @return iterable<Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish>
2323
*/
2424
public function call(string $call, array $params, array $pathChunks) : iterable
2525
{

tests/app/src/Router/List/Pets.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(private \League\OpenAPIValidation\Schema\SchemaValid
1919
{
2020
}
2121
/**
22-
* @return iterable<(Schema\Cat | Schema\Dog | Schema\Bird | Schema\Fish)>
22+
* @return iterable<Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish>
2323
*/
2424
public function listListing(array $params) : iterable
2525
{

tests/app/src/Router/List/Two.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(private \ApiClients\Client\PetStore\Routers $routers
1919
{
2020
}
2121
/**
22-
* @return iterable<(Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish)>
22+
* @return iterable<Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish>
2323
*/
2424
public function call(string $call, array $params, array $pathChunks) : iterable
2525
{

tests/app/src/Router/Post/Pets.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(private \League\OpenAPIValidation\Schema\SchemaValid
1919
{
2020
}
2121
/**
22-
* @return array{code: int}
22+
* @return array{code:int}
2323
*/
2424
public function create(array $params) : array
2525
{

tests/app/src/Router/Post/Two.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(private \ApiClients\Client\PetStore\Routers $routers
1919
{
2020
}
2121
/**
22-
* @return array{code: int}
22+
* @return array{code:int}
2323
*/
2424
public function call(string $call, array $params, array $pathChunks) : array
2525
{

0 commit comments

Comments
 (0)