PHP 8 Compatibility - GoogleAnalyticsReportsApiFeed > currentUrl

Created on 27 July 2022, over 2 years ago
Updated 23 January 2023, almost 2 years ago

Problem/Motivation

When running phpcs with the PHPCompatibility standard for PHP 8.0 check, we get an error:

FILE: ...reports/google_analytics_reports_api/src/GoogleAnalyticsReportsApiFeed.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 218 | ERROR | "$this" can no longer be used in a plain function or method
     |       | since PHP 7.1.
--------------------------------------------------------------------------------

Checking the method that uses the $this outside object context which is currentUrl(), I've noted that method is not longer in use since 2019! See commit b9aa3ce1

Steps to reproduce

Run phpcs with PHPCompatibility standards, as example:

phpcs --standard=PHPCompatibility \
	  --runtime-set testVersion "8.0-" \
	  -p \
	  --extensions=php,module,inc,install,test,profile,theme \
 	  ./modules/contrib/google_analytics_reports

And note the error.

Proposed resolution

I think we can safely remove that method currentUrl since is not longer in use and is throwing the PHP 8 compatibility error.

Remaining tasks

  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ✅ Testing to ensure no regression
  • ➖ Automated unit testing coverage
  • ➖ Automated functional testing coverage
  • ➖ UX/UI designer responsibilities
  • ➖ Readability
  • ➖ Accessibility
  • ➖ Performance
  • ➖ Security
  • ➖ Documentation
  • ➖ Code review by maintainers
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Release notes snippet
  • ❌ Release google_analytics_reports-8.x-3.0

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

🐛 Bug report
Status

Fixed

Version

3.0

Component

API module

Created by

🇦🇷Argentina anairamzap Buenos Aires

Live updates comments and jobs are added and updated live.
  • PHP 8.0

    The issue particularly affects sites running on PHP version 8.0.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024