PHP 8.2 Deprecated function: Creation of dynamic property

Created on 4 October 2024, about 2 months ago

Problem/Motivation

Update to PHP 8.2 or later, observe the following warning:

Deprecated function: Creation of dynamic property Drupal\group_purl\Context\GroupPurlContext::$contexts is deprecated in Drupal\group_purl\Context\GroupPurlContext->onModifierMatched() (line 77 of modules/contrib/group_purl/src/Context/GroupPurlContext.php).

Proposed resolution

The error is due to the creation of a dynamic property, which is deprecated in PHP 8.2 and later versions. In GroupPurlContext class, we're assigning a value to $this->contexts without declaring it as a class property. To fix this issue, we need to declare the $contexts property within the class.

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States scottatdrake

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024