Skip to content

Correct implicit null parameter types which are deprecated in PHP 8.4 #832

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

Open
wants to merge 1 commit into
base: v3-v2021-02-25
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
7 changes: 4 additions & 3 deletions lib/recurly/base_client.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ abstract class BaseClient
/**
* Constructor
*
* @param string $api_key The API key to use when making requests
* @param string $options initialize options
* @param string $api_key The API key to use when making requests
* @param ?LoggerInterface $logger Logger
* @param string $options initialize options
*
* In addition to the options managed by BaseClient, it accepts the following options:
* - "region" to define the Data Center connection - defaults to "us";
*/
public function __construct(string $api_key, LoggerInterface $logger = null, array $options = [])
public function __construct(string $api_key, ?LoggerInterface $logger = null, array $options = [])
{
$this->_api_key = $api_key;
if (isset($options['region'])) {
Expand Down
8 changes: 4 additions & 4 deletions lib/recurly/recurly_error.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ class RecurlyError extends \Error

/**
* Constructor
*
* @param string $message The error message from the API response
* @param \Recurly\Resources\ErrorMayHaveTransaction $api_error The error from the API response
*
* @param string $message The error message from the API response
* @param ?\Recurly\Resources\ErrorMayHaveTransaction $api_error The error from the API response
*/
public function __construct(string $message, \Recurly\Resources\ErrorMayHaveTransaction $api_error = null)
public function __construct(string $message, ?\Recurly\Resources\ErrorMayHaveTransaction $api_error = null)
{
parent::__construct($message);
$this->_api_error = $api_error;
Expand Down
10 changes: 5 additions & 5 deletions lib/recurly/recurly_resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ public static function fromEmpty(\Recurly\Response $response): \Recurly\EmptyRes

/**
* Converts a Recurly response object into a \Recurly\RecurlyResource.
*
* @param \Recurly\Response $response The Recurly HTTP Response
* @param object $json (optional) JSON payload to use instead of
*
* @param \Recurly\Response $response The Recurly HTTP Response
* @param ?object $json (optional) JSON payload to use instead of
* the $response's. Primarily used for errors
*
*
* @return \Recurly\RecurlyResource An instance of a Recurly Resource
*/
public static function fromResponse(\Recurly\Response $response, object $json = null): \Recurly\RecurlyResource
public static function fromResponse(\Recurly\Response $response, ?object $json = null): \Recurly\RecurlyResource
{
$json = is_null($json) ? $response->getJsonResponse() : $json;
$klass_name = static::resourceClass($json->object);
Expand Down