Skip to content

Deprecation Warnings in ApiResponse::__construct() Due to Implicit Nullable Parameters (PHP 8.1+) #143

@adrianaditech

Description

@adrianaditech

When using the RingCentral PHP SDK on PHP 8.1 or later, the following deprecation warnings are triggered:

PHP Deprecated:  RingCentral\SDK\Http\ApiResponse::__construct(): Implicitly marking parameter $request as nullable is deprecated, the explicit nullable type must be used instead in /vendor/ringcentral/ringcentral-php/src/Http/ApiResponse.php on line 40

PHP Deprecated:  RingCentral\SDK\Http\ApiResponse::__construct(): Implicitly marking parameter $response as nullable is deprecated, the explicit nullable type must be used instead in /vendor/ringcentral/ringcentral-php/src/Http/ApiResponse.php on line 40

The constructor of RingCentral\SDK\Http\ApiResponse implicitly allows $request and $response to be null, but the parameters are not declared with explicit nullable types (e.g., ?RequestInterface). As of PHP 8.1, implicit nullability is deprecated and triggers warnings.

Suggested Fix
Update the constructor signature in ApiResponse.php to explicitly declare nullable types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions