Use of "static" in callables is deprecated

Created on 30 July 2024, 4 months ago
Updated 31 July 2024, 4 months ago

Problem/Motivation

When using the module with PHP 8.2, the following warning is displayed on the template management page:

Deprecated: Use of "static" in callables is deprecated in /web/modules/contrib/wysiwyg_template/src/Entity/Template.php on line 178

Steps to reproduce

  1. Have PHP 8.2 installed.
  2. Checkout the latest code from the 3.x branch.
  3. Optionally, install Drupal 10 and apply the patch from https://www.drupal.org/project/wysiwyg_template/issues/3354588 💬 Drupal 10 compatible release Needs review that will make the module compatible with Drupal 10.
  4. Enable the module.
  5. Go to /admin/config/content/wysiwyg-templates and see that the warning is displayed.

Proposed resolution

Current code:

uasort($entities, 'static::sort');

Proposed code:

uasort($entities, static::class . '::sort');
🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇱🇻Latvia maijs

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

Comments & Activities

Production build 0.71.5 2024