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

PHP deprecated warning message #1247

Open
tanaeakihiko opened this issue Jan 11, 2025 · 0 comments · May be fixed by #1248
Open

PHP deprecated warning message #1247

tanaeakihiko opened this issue Jan 11, 2025 · 0 comments · May be fixed by #1248

Comments

@tanaeakihiko
Copy link

What are you attempting to do
I'll tweet message.

Expected behavior
I don't get PHP waring message.

Actual behavior
I get PHP warning messages as bellow.

PHP Deprecated: Abraham\TwitterOAuth\HmacSha1::buildSignature():
Implicitly marking parameter $token as nullable is deprecated,
the explicit nullable type must be used instead in /app/vendor/abraham/twitteroauth/src/HmacSha1.php on line 32
PHP Deprecated: Abraham\TwitterOAuth\SignatureMethod::buildSignature():
Implicitly marking parameter $token as nullable is deprecated,
the explicit nullable type must be used instead in /app/vendor/abraham/twitteroauth/src/SignatureMethod.php on line 37
PHP Deprecated: Abraham\TwitterOAuth\Request::fromConsumerAndToken():
Implicitly marking parameter $token as nullable is deprecated,
the explicit nullable type must be used instead in /app/vendor/abraham/twitteroauth/src/Request.php on line 51
PHP Deprecated: Abraham\TwitterOAuth\Request::signRequest():
Implicitly marking parameter $token as nullable is deprecated,
the explicit nullable type must be used instead in /app/vendor/abraham/twitteroauth/src/Request.php on line 251
PHP Deprecated: Abraham\TwitterOAuth\Request::buildSignature():
Implicitly marking parameter $token as nullable is deprecated,
the explicit nullable type must be used instead in /app/vendor/abraham/twitteroauth/src/Request.php on line 271

Code example

$connection = new TwitterOAuth(...);
$connection->setApiVersion('2');
$res = $connection->post('tweets', ['text' => $message], ['jsonPayload' => true]);

Versions:

  • TwitterOAuth: v7.0.0
  • PHP: v8.4

Additional context
"PHP RFC: Deprecate implicitly nullable parameter types"
https://wiki.php.net/rfc/deprecate-implicitly-nullable-types

In PHP 8.4 or higher,
if we make code as like below,
function foo(T $var = null) {}
we get PHP warning message.
And in PHP 9, we'll get PHP Fatal error message.

Thank you for your nice product.
You have time to fix, I want to fix and make Pull Request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant