Fixing PHP 8.4 Deprecations
-
I found this plugin has a couple of deprecations under PHP 8.4:
Deprecated: Abraham\TwitterOAuth\HmacSha1::buildSignature(): Implicitly marking parameter $token as nullable is deprecated, the explicit nullable type must be used instead in /wp-content/plugins/autoshare-for-twitter/vendor/abraham/twitteroauth/src/HmacSha1.php on line 32
Deprecated: Abraham\TwitterOAuth\SignatureMethod::buildSignature(): Implicitly marking parameter $token as nullable is deprecated, the explicit nullable type must be used instead in /wp-content/plugins/autoshare-for-twitter/vendor/abraham/twitteroauth/src/SignatureMethod.php on line 37
So I fixed them as follows:
/wp-content/plugins/autoshare-for-twitter/vendor/abraham/twitteroauth/src/HmacSha1.php on line 32
Change:
public function buildSignature(
Request $request,
Consumer $consumer,
Token $token = null
To:
public function buildSignature(
Request $request,
Consumer $consumer,
Token|null $token = null/wp-content/plugins/autoshare-for-twitter/vendor/abraham/twitteroauth/src/SignatureMethod.php on line 37
Change:
abstract public function buildSignature(
Request $request,
Consumer $consumer,
Token $token = null
);
To:
abstract public function buildSignature(
Request $request,
Consumer $consumer,
Token|null $token = null
);
You must be logged in to reply to this topic.