[PHP][php-nextgen] Improve method parameter typing (#20361)

* Fix #20354 - Nullable mixed type is not allowed

* Add parameter types for request and asyncWithHttpInfo functions
This commit is contained in:
Julian Vennen
2024-12-21 08:53:51 +01:00
committed by GitHub
parent 806b99e43a
commit eceef28850
18 changed files with 384 additions and 380 deletions

View File

@@ -633,7 +633,7 @@ class BodyApi
* @return PromiseInterface
*/
public function testBodyApplicationOctetstreamBinaryAsyncWithHttpInfo(
$body = null,
?\SplFileObject $body = null,
string $contentType = self::contentTypes['testBodyApplicationOctetstreamBinary'][0]
): PromiseInterface
{
@@ -686,7 +686,7 @@ class BodyApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testBodyApplicationOctetstreamBinaryRequest(
$body = null,
?\SplFileObject $body = null,
string $contentType = self::contentTypes['testBodyApplicationOctetstreamBinary'][0]
): Request
{
@@ -949,7 +949,7 @@ class BodyApi
* @return PromiseInterface
*/
public function testBodyMultipartFormdataArrayOfBinaryAsyncWithHttpInfo(
$files,
array $files,
string $contentType = self::contentTypes['testBodyMultipartFormdataArrayOfBinary'][0]
): PromiseInterface
{
@@ -1002,7 +1002,7 @@ class BodyApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testBodyMultipartFormdataArrayOfBinaryRequest(
$files,
array $files,
string $contentType = self::contentTypes['testBodyMultipartFormdataArrayOfBinary'][0]
): Request
{
@@ -1278,7 +1278,7 @@ class BodyApi
* @return PromiseInterface
*/
public function testBodyMultipartFormdataSingleBinaryAsyncWithHttpInfo(
$my_file = null,
?\SplFileObject $my_file = null,
string $contentType = self::contentTypes['testBodyMultipartFormdataSingleBinary'][0]
): PromiseInterface
{
@@ -1331,7 +1331,7 @@ class BodyApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testBodyMultipartFormdataSingleBinaryRequest(
$my_file = null,
?\SplFileObject $my_file = null,
string $contentType = self::contentTypes['testBodyMultipartFormdataSingleBinary'][0]
): Request
{
@@ -1601,7 +1601,7 @@ class BodyApi
* @return PromiseInterface
*/
public function testEchoBodyAllOfPetAsyncWithHttpInfo(
$pet = null,
?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyAllOfPet'][0]
): PromiseInterface
{
@@ -1654,7 +1654,7 @@ class BodyApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyAllOfPetRequest(
$pet = null,
?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyAllOfPet'][0]
): Request
{
@@ -1745,7 +1745,7 @@ class BodyApi
* @return string
*/
public function testEchoBodyFreeFormObjectResponseString(
?array $body = null,
array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): string
{
@@ -1766,7 +1766,7 @@ class BodyApi
* @return array of string, HTTP status code, HTTP response headers (array of strings)
*/
public function testEchoBodyFreeFormObjectResponseStringWithHttpInfo(
?array $body = null,
array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): array
{
@@ -1893,7 +1893,7 @@ class BodyApi
* @return PromiseInterface
*/
public function testEchoBodyFreeFormObjectResponseStringAsync(
?array $body = null,
array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): PromiseInterface
{
@@ -1917,7 +1917,7 @@ class BodyApi
* @return PromiseInterface
*/
public function testEchoBodyFreeFormObjectResponseStringAsyncWithHttpInfo(
$body = null,
array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): PromiseInterface
{
@@ -1970,7 +1970,7 @@ class BodyApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyFreeFormObjectResponseStringRequest(
$body = null,
array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): Request
{
@@ -2233,7 +2233,7 @@ class BodyApi
* @return PromiseInterface
*/
public function testEchoBodyPetAsyncWithHttpInfo(
$pet = null,
?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyPet'][0]
): PromiseInterface
{
@@ -2286,7 +2286,7 @@ class BodyApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyPetRequest(
$pet = null,
?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyPet'][0]
): Request
{
@@ -2549,7 +2549,7 @@ class BodyApi
* @return PromiseInterface
*/
public function testEchoBodyPetResponseStringAsyncWithHttpInfo(
$pet = null,
?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyPetResponseString'][0]
): PromiseInterface
{
@@ -2602,7 +2602,7 @@ class BodyApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyPetResponseStringRequest(
$pet = null,
?\OpenAPI\Client\Model\Pet $pet = null,
string $contentType = self::contentTypes['testEchoBodyPetResponseString'][0]
): Request
{
@@ -2865,7 +2865,7 @@ class BodyApi
* @return PromiseInterface
*/
public function testEchoBodyStringEnumAsyncWithHttpInfo(
$body = null,
?string $body = null,
string $contentType = self::contentTypes['testEchoBodyStringEnum'][0]
): PromiseInterface
{
@@ -2918,7 +2918,7 @@ class BodyApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyStringEnumRequest(
$body = null,
?string $body = null,
string $contentType = self::contentTypes['testEchoBodyStringEnum'][0]
): Request
{
@@ -3181,7 +3181,7 @@ class BodyApi
* @return PromiseInterface
*/
public function testEchoBodyTagResponseStringAsyncWithHttpInfo(
$tag = null,
?\OpenAPI\Client\Model\Tag $tag = null,
string $contentType = self::contentTypes['testEchoBodyTagResponseString'][0]
): PromiseInterface
{
@@ -3234,7 +3234,7 @@ class BodyApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testEchoBodyTagResponseStringRequest(
$tag = null,
?\OpenAPI\Client\Model\Tag $tag = null,
string $contentType = self::contentTypes['testEchoBodyTagResponseString'][0]
): Request
{

View File

@@ -328,9 +328,9 @@ class FormApi
* @return PromiseInterface
*/
public function testFormIntegerBooleanStringAsyncWithHttpInfo(
$integer_form = null,
$boolean_form = null,
$string_form = null,
?int $integer_form = null,
?bool $boolean_form = null,
?string $string_form = null,
string $contentType = self::contentTypes['testFormIntegerBooleanString'][0]
): PromiseInterface
{
@@ -385,9 +385,9 @@ class FormApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testFormIntegerBooleanStringRequest(
$integer_form = null,
$boolean_form = null,
$string_form = null,
?int $integer_form = null,
?bool $boolean_form = null,
?string $string_form = null,
string $contentType = self::contentTypes['testFormIntegerBooleanString'][0]
): Request
{
@@ -657,7 +657,7 @@ class FormApi
* @return PromiseInterface
*/
public function testFormObjectMultipartAsyncWithHttpInfo(
$marker,
\OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker $marker,
string $contentType = self::contentTypes['testFormObjectMultipart'][0]
): PromiseInterface
{
@@ -710,7 +710,7 @@ class FormApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testFormObjectMultipartRequest(
$marker,
\OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker $marker,
string $contentType = self::contentTypes['testFormObjectMultipart'][0]
): Request
{
@@ -1011,12 +1011,12 @@ class FormApi
* @return PromiseInterface
*/
public function testFormOneofAsyncWithHttpInfo(
$form1 = null,
$form2 = null,
$form3 = null,
$form4 = null,
$id = null,
$name = null,
?string $form1 = null,
?int $form2 = null,
?string $form3 = null,
?bool $form4 = null,
?int $id = null,
?string $name = null,
string $contentType = self::contentTypes['testFormOneof'][0]
): PromiseInterface
{
@@ -1074,12 +1074,12 @@ class FormApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testFormOneofRequest(
$form1 = null,
$form2 = null,
$form3 = null,
$form4 = null,
$id = null,
$name = null,
?string $form1 = null,
?int $form2 = null,
?string $form3 = null,
?bool $form4 = null,
?int $id = null,
?string $name = null,
string $contentType = self::contentTypes['testFormOneof'][0]
): Request
{

View File

@@ -336,11 +336,11 @@ class HeaderApi
* @return PromiseInterface
*/
public function testHeaderIntegerBooleanStringEnumsAsyncWithHttpInfo(
$integer_header = null,
$boolean_header = null,
$string_header = null,
$enum_nonref_string_header = null,
$enum_ref_string_header = null,
?int $integer_header = null,
?bool $boolean_header = null,
?string $string_header = null,
?string $enum_nonref_string_header = null,
?\OpenAPI\Client\Model\StringEnumRef $enum_ref_string_header = null,
string $contentType = self::contentTypes['testHeaderIntegerBooleanStringEnums'][0]
): PromiseInterface
{
@@ -397,11 +397,11 @@ class HeaderApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testHeaderIntegerBooleanStringEnumsRequest(
$integer_header = null,
$boolean_header = null,
$string_header = null,
$enum_nonref_string_header = null,
$enum_ref_string_header = null,
?int $integer_header = null,
?bool $boolean_header = null,
?string $string_header = null,
?string $enum_nonref_string_header = null,
?\OpenAPI\Client\Model\StringEnumRef $enum_ref_string_header = null,
string $contentType = self::contentTypes['testHeaderIntegerBooleanStringEnums'][0]
): Request
{

View File

@@ -329,10 +329,10 @@ class PathApi
* @return PromiseInterface
*/
public function testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathAsyncWithHttpInfo(
$path_string,
$path_integer,
$enum_nonref_string_path,
$enum_ref_string_path,
string $path_string,
int $path_integer,
string $enum_nonref_string_path,
\OpenAPI\Client\Model\StringEnumRef $enum_ref_string_path,
string $contentType = self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'][0]
): PromiseInterface
{
@@ -388,10 +388,10 @@ class PathApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequest(
$path_string,
$path_integer,
$enum_nonref_string_path,
$enum_ref_string_path,
string $path_string,
int $path_integer,
string $enum_nonref_string_path,
\OpenAPI\Client\Model\StringEnumRef $enum_ref_string_path,
string $contentType = self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'][0]
): Request
{

View File

@@ -342,8 +342,8 @@ class QueryApi
* @return PromiseInterface
*/
public function testEnumRefStringAsyncWithHttpInfo(
$enum_nonref_string_query = null,
$enum_ref_string_query = null,
?string $enum_nonref_string_query = null,
?\OpenAPI\Client\Model\StringEnumRef $enum_ref_string_query = null,
string $contentType = self::contentTypes['testEnumRefString'][0]
): PromiseInterface
{
@@ -397,8 +397,8 @@ class QueryApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testEnumRefStringRequest(
$enum_nonref_string_query = null,
$enum_ref_string_query = null,
?string $enum_nonref_string_query = null,
?\OpenAPI\Client\Model\StringEnumRef $enum_ref_string_query = null,
string $contentType = self::contentTypes['testEnumRefString'][0]
): Request
{
@@ -687,9 +687,9 @@ class QueryApi
* @return PromiseInterface
*/
public function testQueryDatetimeDateStringAsyncWithHttpInfo(
$datetime_query = null,
$date_query = null,
$string_query = null,
?\DateTime $datetime_query = null,
?\DateTime $date_query = null,
?string $string_query = null,
string $contentType = self::contentTypes['testQueryDatetimeDateString'][0]
): PromiseInterface
{
@@ -744,9 +744,9 @@ class QueryApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryDatetimeDateStringRequest(
$datetime_query = null,
$date_query = null,
$string_query = null,
?\DateTime $datetime_query = null,
?\DateTime $date_query = null,
?string $string_query = null,
string $contentType = self::contentTypes['testQueryDatetimeDateString'][0]
): Request
{
@@ -1045,9 +1045,9 @@ class QueryApi
* @return PromiseInterface
*/
public function testQueryIntegerBooleanStringAsyncWithHttpInfo(
$integer_query = null,
$boolean_query = null,
$string_query = null,
?int $integer_query = null,
?bool $boolean_query = null,
?string $string_query = null,
string $contentType = self::contentTypes['testQueryIntegerBooleanString'][0]
): PromiseInterface
{
@@ -1102,9 +1102,9 @@ class QueryApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryIntegerBooleanStringRequest(
$integer_query = null,
$boolean_query = null,
$string_query = null,
?int $integer_query = null,
?bool $boolean_query = null,
?string $string_query = null,
string $contentType = self::contentTypes['testQueryIntegerBooleanString'][0]
): Request
{
@@ -1389,7 +1389,7 @@ class QueryApi
* @return PromiseInterface
*/
public function testQueryStyleDeepObjectExplodeTrueObjectAsyncWithHttpInfo(
$query_object = null,
?\OpenAPI\Client\Model\Pet $query_object = null,
string $contentType = self::contentTypes['testQueryStyleDeepObjectExplodeTrueObject'][0]
): PromiseInterface
{
@@ -1442,7 +1442,7 @@ class QueryApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleDeepObjectExplodeTrueObjectRequest(
$query_object = null,
?\OpenAPI\Client\Model\Pet $query_object = null,
string $contentType = self::contentTypes['testQueryStyleDeepObjectExplodeTrueObject'][0]
): Request
{
@@ -1707,7 +1707,7 @@ class QueryApi
* @return PromiseInterface
*/
public function testQueryStyleDeepObjectExplodeTrueObjectAllOfAsyncWithHttpInfo(
$query_object = null,
?\OpenAPI\Client\Model\TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter $query_object = null,
string $contentType = self::contentTypes['testQueryStyleDeepObjectExplodeTrueObjectAllOf'][0]
): PromiseInterface
{
@@ -1760,7 +1760,7 @@ class QueryApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleDeepObjectExplodeTrueObjectAllOfRequest(
$query_object = null,
?\OpenAPI\Client\Model\TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter $query_object = null,
string $contentType = self::contentTypes['testQueryStyleDeepObjectExplodeTrueObjectAllOf'][0]
): Request
{
@@ -1853,7 +1853,7 @@ class QueryApi
* @return string
*/
public function testQueryStyleFormExplodeFalseArrayInteger(
?array $query_object = null,
array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): string
{
@@ -1874,7 +1874,7 @@ class QueryApi
* @return array of string, HTTP status code, HTTP response headers (array of strings)
*/
public function testQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(
?array $query_object = null,
array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): array
{
@@ -2001,7 +2001,7 @@ class QueryApi
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeFalseArrayIntegerAsync(
?array $query_object = null,
array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): PromiseInterface
{
@@ -2025,7 +2025,7 @@ class QueryApi
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeFalseArrayIntegerAsyncWithHttpInfo(
$query_object = null,
array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): PromiseInterface
{
@@ -2078,7 +2078,7 @@ class QueryApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeFalseArrayIntegerRequest(
$query_object = null,
array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayInteger'][0]
): Request
{
@@ -2171,7 +2171,7 @@ class QueryApi
* @return string
*/
public function testQueryStyleFormExplodeFalseArrayString(
?array $query_object = null,
array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): string
{
@@ -2192,7 +2192,7 @@ class QueryApi
* @return array of string, HTTP status code, HTTP response headers (array of strings)
*/
public function testQueryStyleFormExplodeFalseArrayStringWithHttpInfo(
?array $query_object = null,
array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): array
{
@@ -2319,7 +2319,7 @@ class QueryApi
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeFalseArrayStringAsync(
?array $query_object = null,
array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): PromiseInterface
{
@@ -2343,7 +2343,7 @@ class QueryApi
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeFalseArrayStringAsyncWithHttpInfo(
$query_object = null,
array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): PromiseInterface
{
@@ -2396,7 +2396,7 @@ class QueryApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeFalseArrayStringRequest(
$query_object = null,
array $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeFalseArrayString'][0]
): Request
{
@@ -2661,7 +2661,7 @@ class QueryApi
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeTrueArrayStringAsyncWithHttpInfo(
$query_object = null,
?\OpenAPI\Client\Model\TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueArrayString'][0]
): PromiseInterface
{
@@ -2714,7 +2714,7 @@ class QueryApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeTrueArrayStringRequest(
$query_object = null,
?\OpenAPI\Client\Model\TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueArrayString'][0]
): Request
{
@@ -2979,7 +2979,7 @@ class QueryApi
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeTrueObjectAsyncWithHttpInfo(
$query_object = null,
?\OpenAPI\Client\Model\Pet $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueObject'][0]
): PromiseInterface
{
@@ -3032,7 +3032,7 @@ class QueryApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeTrueObjectRequest(
$query_object = null,
?\OpenAPI\Client\Model\Pet $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueObject'][0]
): Request
{
@@ -3297,7 +3297,7 @@ class QueryApi
* @return PromiseInterface
*/
public function testQueryStyleFormExplodeTrueObjectAllOfAsyncWithHttpInfo(
$query_object = null,
?\OpenAPI\Client\Model\DataQuery $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueObjectAllOf'][0]
): PromiseInterface
{
@@ -3350,7 +3350,7 @@ class QueryApi
* @return \GuzzleHttp\Psr7\Request
*/
public function testQueryStyleFormExplodeTrueObjectAllOfRequest(
$query_object = null,
?\OpenAPI\Client\Model\DataQuery $query_object = null,
string $contentType = self::contentTypes['testQueryStyleFormExplodeTrueObjectAllOf'][0]
): Request
{