ITADN

PHP deprecated warning message

#1247Closedtanaeakihiko 创建于 2025-01-11
BugTriage
T
tanaeakihikocommented
**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** ```php $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.
关闭于 2025-03-11 2 条评论