PHP8 compatibility

Created on 11 January 2023, almost 2 years ago
Updated 29 January 2023, almost 2 years ago

Problem/Motivation

When running the module with php8.1 I get the following error

Deprecated function: Return type of Drupal\eu_cookie_compliance_matomo\Component\Render\EuCookieComplianceMatomoJavaScriptSnippet::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include() (line 12 of modules/contrib/eu_cookie_compliance_matomo/src/Component/Render/EuCookieComplianceMatomoJavaScriptSnippet.php).

According to https://www.drupal.org/project/google_analytics/issues/3258588 🐛 Deprecated function: Return type of Drupal\google_analytics\Component\Render\GoogleAnalyticsJavaScriptSnippet::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be u Fixed I' created a patch, that works for me.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇩🇪Germany uniquename Berlin

Live updates comments and jobs are added and updated live.
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