Return type not specified to match NetworkBase::initSdk()

Created on 11 November 2024, 11 days ago

Problem/Motivation

Later versions of PHP (> 8.3.0) throw a `TypeError` if a return type is not specified. This results in the following error:

PHP Fatal error: Declaration of Drupal\social_post_twitter\Plugin\Network\TwitterPost::initSdk() must be compatible with Drupal\social_api\Plugin\NetworkBase::initSdk(): mixed in /app/docroot/modules/contrib/social_post_twitter/src/Plugin/Network/TwitterPost.php on line 30

Steps to reproduce

Install social_post_twitter in an PHP 8.3 environment and perform any function that requires a Twitter social post.

Proposed resolution

Update type hinting for classes that extend base classes.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇦🇺Australia malks

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @malks
  • First commit to issue fork.
  • Merge request !8Fixed Declaration issue → (Open) created by Unnamed author
  • Pipeline finished with Failed
    11 days ago
    Total: 42s
    #334986
  • 🇮🇳India sarwan_verma

    Hi,

    I have resolved the "declaration" issue related to PHP 8.3 and created MR!8.
    Please review and verify.

    Thanks!

  • 🇦🇺Australia malks

    Hi @sarwan_verma, you beat me to it! I think your indentation is not quite right and is breaking the lint step in the tests. Can you fix?

  • Pipeline finished with Failed
    10 days ago
    Total: 43s
    #335161
  • Pipeline finished with Success
    10 days ago
    Total: 141s
    #335170
  • Pipeline finished with Success
    9 days ago
    Total: 246s
    #336906
Production build 0.71.5 2024