Skip to content
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

Fix PHP 8+ compat issues #126

Merged
merged 1 commit into from Apr 4, 2023
Merged

Fix PHP 8+ compat issues #126

merged 1 commit into from Apr 4, 2023

Conversation

sanmai
Copy link
Member

@sanmai sanmai commented Apr 4, 2023

Fixes #124

I did three things here:

  • Added missing properties.
  • Added variable types and expanded argument types to include null where appropriate.
  • Fixed one issue with possibly missing array key.

private $apiKey;

/** @var RequestHandler */
public $requestHandler;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These properties were effectively public before, so to avoid BC breaks we have to keep them public as well.

@@ -96,7 +107,7 @@ public function request($method, $path, $options)
);
$oauth->sign_request($this->signatureMethod, $this->consumer, $this->token);
$authHeader = $oauth->to_header();
$pieces = explode(' ', $authHeader, 2);
$pieces = explode(' ', $authHeader, 2) + [1 => ''];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only code change here: to guard against $authHeader having no space.

Copy link

@diegoaer diegoaer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@sanmai sanmai merged commit d1bedce into tumblr:master Apr 4, 2023
12 checks passed
@sanmai sanmai deleted the pr/2023-04/php8 branch April 4, 2023 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

compatibility issue with php8.2
2 participants