mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
[php-nextgen] minor fix to return type (#16752)
* minor fix to return type * use returnProperty
This commit is contained in:
parent
f5680019b2
commit
5fb6fcf9ef
1
.gitignore
vendored
1
.gitignore
vendored
@ -193,6 +193,7 @@ samples/server/petstore/php-slim4/composer.lock
|
||||
samples/server/petstore/php-symfony/SymfonyBundle-php/composer.lock
|
||||
samples/server/petstore/php-mezzio-ph/composer.lock
|
||||
samples/server/petstore/php-mezzio-ph-modern/composer.lock
|
||||
samples/client/petstore/php-nextgen/OpenAPIClient-php/.phplint.cache/
|
||||
|
||||
# ts
|
||||
samples/client/petstore/typescript-angular2/npm/npm-debug.log
|
||||
|
@ -170,7 +170,11 @@ public class PhpNextgenClientCodegen extends AbstractPhpCodegen {
|
||||
if (operation.returnType == null) {
|
||||
operation.vendorExtensions.putIfAbsent("x-php-return-type", "void");
|
||||
} else {
|
||||
operation.vendorExtensions.putIfAbsent("x-php-return-type", operation.returnType);
|
||||
if (operation.returnProperty.isContainer) { // array or map
|
||||
operation.vendorExtensions.putIfAbsent("x-php-return-type", "array");
|
||||
} else {
|
||||
operation.vendorExtensions.putIfAbsent("x-php-return-type", operation.returnType);
|
||||
}
|
||||
}
|
||||
|
||||
for (CodegenParameter param : operation.allParams) {
|
||||
|
@ -187,7 +187,7 @@ use {{invokerPackage}}\ObjectSerializer;
|
||||
{{#vendorExtensions.x-group-parameters}}
|
||||
array $associative_array
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
): {{vendorExtensions.x-php-return-type}}
|
||||
): {{{vendorExtensions.x-php-return-type}}}
|
||||
{
|
||||
{{#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}}
|
||||
|
@ -0,0 +1,13 @@
|
||||
path:
|
||||
- src/
|
||||
- tests/
|
||||
jobs: 10
|
||||
extensions:
|
||||
- php
|
||||
exclude:
|
||||
- vendor
|
||||
warning: true
|
||||
memory-limit: -1
|
||||
no-cache: false
|
||||
log-json: false
|
||||
log-junit: false
|
@ -827,7 +827,7 @@ class PetApi
|
||||
public function findPetsByStatus(
|
||||
array $status,
|
||||
string $contentType = self::contentTypes['findPetsByStatus'][0]
|
||||
): \OpenAPI\Client\Model\Pet[]
|
||||
): array
|
||||
{
|
||||
list($response) = $this->findPetsByStatusWithHttpInfo($status, $contentType);
|
||||
return $response;
|
||||
@ -1131,7 +1131,7 @@ class PetApi
|
||||
public function findPetsByTags(
|
||||
array $tags,
|
||||
string $contentType = self::contentTypes['findPetsByTags'][0]
|
||||
): \OpenAPI\Client\Model\Pet[]
|
||||
): array
|
||||
{
|
||||
list($response) = $this->findPetsByTagsWithHttpInfo($tags, $contentType);
|
||||
return $response;
|
||||
|
@ -390,7 +390,7 @@ class StoreApi
|
||||
*/
|
||||
public function getInventory(
|
||||
string $contentType = self::contentTypes['getInventory'][0]
|
||||
): array<string,int>
|
||||
): array
|
||||
{
|
||||
list($response) = $this->getInventoryWithHttpInfo($contentType);
|
||||
return $response;
|
||||
|
Loading…
x
Reference in New Issue
Block a user