[php-*] Explicitly declare nullable parameters (#20524)

* [php-nextgen] Explicitly declare nullable parameters explicitly

* Fix some deprecation warnings in other php generators

* [php-nextgen] Fix PHP 8.4 deprecation warnings with nullable/optional array parameters
This commit is contained in:
Julian Vennen
2025-01-23 05:06:15 -05:00
committed by GitHub
parent ad8de61143
commit a68ad56ea9
104 changed files with 209 additions and 208 deletions

View File

@@ -111,9 +111,9 @@ class BodyApi
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
*/
public function __construct(
ClientInterface $client = null,
Configuration $config = null,
HeaderSelector $selector = null,
?ClientInterface $client = null,
?Configuration $config = null,
?HeaderSelector $selector = null,
int $hostIndex = 0
) {
$this->client = $client ?: new Client();
@@ -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(
array $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(
array $body = null,
?array $body = null,
string $contentType = self::contentTypes['testEchoBodyFreeFormObjectResponseString'][0]
): Request
{