Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid return type when method does not return #20639

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ use {{invokerPackage}}\ObjectSerializer;
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
{{#returnType}}
* @return {{{vendorExtensions.x-php-doc-return-type}}}
{{/returnType}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in other languages such as java, the doc is also completely omitted if it's void so make senses php follows the same.

{{#isDeprecated}}
* @deprecated
{{/isDeprecated}}
Expand All @@ -185,7 +187,7 @@ use {{invokerPackage}}\ObjectSerializer;
{{#vendorExtensions.x-group-parameters}}
array $associative_array
{{/vendorExtensions.x-group-parameters}}
): {{{vendorExtensions.x-php-return-type}}}
){{#returnType}}: {{{vendorExtensions.x-php-return-type}}}{{/returnType}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should keep it as seems like that's what the php community prefers: https://stackoverflow.com/a/33671413

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok. looks like a different issue ...

i'll take a further look

{
{{#returnType}}list($response) = {{/returnType}}$this->{{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}, {{/allParams}}{{#servers}}{{#-first}}$hostIndex, $variables, {{/-first}}{{/servers}}$contentType{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}});{{#returnType}}
return $response;{{/returnType}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1165,14 +1165,13 @@ public function fakeHealthGetRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function fakeHttpSignatureTest(
\OpenAPI\Client\Model\Pet $pet,
?string $query_1 = null,
?string $header_1 = null,
string $contentType = self::contentTypes['fakeHttpSignatureTest'][0]
): void
)
{
$this->fakeHttpSignatureTestWithHttpInfo($pet, $query_1, $header_1, $contentType);
}
Expand Down Expand Up @@ -2975,12 +2974,11 @@ public function fakePropertyEnumIntegerSerializeRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function testAdditionalPropertiesReference(
array $request_body,
string $contentType = self::contentTypes['testAdditionalPropertiesReference'][0]
): void
)
{
$this->testAdditionalPropertiesReferenceWithHttpInfo($request_body, $contentType);
}
Expand Down Expand Up @@ -3204,12 +3202,11 @@ public function testAdditionalPropertiesReferenceRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function testBodyWithBinary(
?\SplFileObject $body,
string $contentType = self::contentTypes['testBodyWithBinary'][0]
): void
)
{
$this->testBodyWithBinaryWithHttpInfo($body, $contentType);
}
Expand Down Expand Up @@ -3427,12 +3424,11 @@ public function testBodyWithBinaryRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function testBodyWithFileSchema(
\OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class,
string $contentType = self::contentTypes['testBodyWithFileSchema'][0]
): void
)
{
$this->testBodyWithFileSchemaWithHttpInfo($file_schema_test_class, $contentType);
}
Expand Down Expand Up @@ -3651,13 +3647,12 @@ public function testBodyWithFileSchemaRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function testBodyWithQueryParams(
string $query,
\OpenAPI\Client\Model\User $user,
string $contentType = self::contentTypes['testBodyWithQueryParams'][0]
): void
)
{
$this->testBodyWithQueryParamsWithHttpInfo($query, $user, $contentType);
}
Expand Down Expand Up @@ -4236,7 +4231,6 @@ public function testClientModelRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function testEndpointParameters(
float $number,
Expand All @@ -4254,7 +4248,7 @@ public function testEndpointParameters(
?string $password = null,
?string $callback = null,
string $contentType = self::contentTypes['testEndpointParameters'][0]
): void
)
{
$this->testEndpointParametersWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback, $contentType);
}
Expand Down Expand Up @@ -4725,7 +4719,6 @@ public function testEndpointParametersRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function testEnumParameters(
?array $enum_header_string_array = ['$'],
Expand All @@ -4738,7 +4731,7 @@ public function testEnumParameters(
?array $enum_form_string_array = ['$'],
?string $enum_form_string = '-efg',
string $contentType = self::contentTypes['testEnumParameters'][0]
): void
)
{
$this->testEnumParametersWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_query_model_array, $enum_form_string_array, $enum_form_string, $contentType);
}
Expand Down Expand Up @@ -5094,11 +5087,10 @@ public function testEnumParametersRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function testGroupParameters(
array $associative_array
): void
)
{
$this->testGroupParametersWithHttpInfo($associative_array);
}
Expand Down Expand Up @@ -5414,12 +5406,11 @@ public function testGroupParametersRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function testInlineAdditionalProperties(
array $request_body,
string $contentType = self::contentTypes['testInlineAdditionalProperties'][0]
): void
)
{
$this->testInlineAdditionalPropertiesWithHttpInfo($request_body, $contentType);
}
Expand Down Expand Up @@ -5645,12 +5636,11 @@ public function testInlineAdditionalPropertiesRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function testInlineFreeformAdditionalProperties(
\OpenAPI\Client\Model\TestInlineFreeformAdditionalPropertiesRequest $test_inline_freeform_additional_properties_request,
string $contentType = self::contentTypes['testInlineFreeformAdditionalProperties'][0]
): void
)
{
$this->testInlineFreeformAdditionalPropertiesWithHttpInfo($test_inline_freeform_additional_properties_request, $contentType);
}
Expand Down Expand Up @@ -5877,13 +5867,12 @@ public function testInlineFreeformAdditionalPropertiesRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function testJsonFormData(
string $param,
string $param2,
string $contentType = self::contentTypes['testJsonFormData'][0]
): void
)
{
$this->testJsonFormDataWithHttpInfo($param, $param2, $contentType);
}
Expand Down Expand Up @@ -6125,12 +6114,11 @@ public function testJsonFormDataRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function testNullable(
\OpenAPI\Client\Model\ChildWithNullable $child_with_nullable,
string $contentType = self::contentTypes['testNullable'][0]
): void
)
{
$this->testNullableWithHttpInfo($child_with_nullable, $contentType);
}
Expand Down Expand Up @@ -6360,7 +6348,6 @@ public function testNullableRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function testQueryParameterCollectionFormat(
array $pipe,
Expand All @@ -6371,7 +6358,7 @@ public function testQueryParameterCollectionFormat(
string $allow_empty,
?array $language = null,
string $contentType = self::contentTypes['testQueryParameterCollectionFormat'][0]
): void
)
{
$this->testQueryParameterCollectionFormatWithHttpInfo($pipe, $ioutil, $http, $url, $context, $allow_empty, $language, $contentType);
}
Expand Down Expand Up @@ -6731,12 +6718,11 @@ public function testQueryParameterCollectionFormatRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function testStringMapReference(
array $request_body,
string $contentType = self::contentTypes['testStringMapReference'][0]
): void
)
{
$this->testStringMapReferenceWithHttpInfo($request_body, $contentType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,13 @@ public function getConfig(): Configuration
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function addPet(
\OpenAPI\Client\Model\Pet $pet,
?int $hostIndex = null,
array $variables = [],
string $contentType = self::contentTypes['addPet'][0]
): void
)
{
$this->addPetWithHttpInfo($pet, $hostIndex, $variables, $contentType);
}
Expand Down Expand Up @@ -546,13 +545,12 @@ protected function getHostSettingsForaddPet(): array
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function deletePet(
int $pet_id,
?string $api_key = null,
string $contentType = self::contentTypes['deletePet'][0]
): void
)
{
$this->deletePetWithHttpInfo($pet_id, $api_key, $contentType);
}
Expand Down Expand Up @@ -1803,14 +1801,13 @@ public function getPetByIdRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function updatePet(
\OpenAPI\Client\Model\Pet $pet,
?int $hostIndex = null,
array $variables = [],
string $contentType = self::contentTypes['updatePet'][0]
): void
)
{
$this->updatePetWithHttpInfo($pet, $hostIndex, $variables, $contentType);
}
Expand Down Expand Up @@ -2174,14 +2171,13 @@ protected function getHostSettingsForupdatePet(): array
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function updatePetWithForm(
int $pet_id,
?string $name = null,
?string $status = null,
string $contentType = self::contentTypes['updatePetWithForm'][0]
): void
)
{
$this->updatePetWithFormWithHttpInfo($pet_id, $name, $status, $contentType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,11 @@ public function getConfig(): Configuration
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function deleteOrder(
string $order_id,
string $contentType = self::contentTypes['deleteOrder'][0]
): void
)
{
$this->deleteOrderWithHttpInfo($order_id, $contentType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,11 @@ public function getConfig(): Configuration
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function createUser(
\OpenAPI\Client\Model\User $user,
string $contentType = self::contentTypes['createUser'][0]
): void
)
{
$this->createUserWithHttpInfo($user, $contentType);
}
Expand Down Expand Up @@ -384,12 +383,11 @@ public function createUserRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function createUsersWithArrayInput(
array $user,
string $contentType = self::contentTypes['createUsersWithArrayInput'][0]
): void
)
{
$this->createUsersWithArrayInputWithHttpInfo($user, $contentType);
}
Expand Down Expand Up @@ -615,12 +613,11 @@ public function createUsersWithArrayInputRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function createUsersWithListInput(
array $user,
string $contentType = self::contentTypes['createUsersWithListInput'][0]
): void
)
{
$this->createUsersWithListInputWithHttpInfo($user, $contentType);
}
Expand Down Expand Up @@ -846,12 +843,11 @@ public function createUsersWithListInputRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function deleteUser(
string $username,
string $contentType = self::contentTypes['deleteUser'][0]
): void
)
{
$this->deleteUserWithHttpInfo($username, $contentType);
}
Expand Down Expand Up @@ -1750,11 +1746,10 @@ public function loginUserRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function logoutUser(
string $contentType = self::contentTypes['logoutUser'][0]
): void
)
{
$this->logoutUserWithHttpInfo($contentType);
}
Expand Down Expand Up @@ -1959,13 +1954,12 @@ public function logoutUserRequest(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return void
*/
public function updateUser(
string $username,
\OpenAPI\Client\Model\User $user,
string $contentType = self::contentTypes['updateUser'][0]
): void
)
{
$this->updateUserWithHttpInfo($username, $user, $contentType);
}
Expand Down
Loading