PHP8 compatibility

Created on 11 January 2023, over 1 year ago
Updated 29 January 2023, over 1 year 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

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.69.0 2024