PHP 8.2 deprecation in TagService.php

Created on 8 August 2023, over 1 year ago
Updated 7 April 2024, 8 months ago

Problem/Motivation

When running with PHP 8.2, TagService will cause following warning:

Deprecated function: Use of "static" in callables is deprecated in Drupal\tagclouds\TagService->sortTags() (line 88 of modules/contrib/tagclouds/src/TagService.php).

Steps to reproduce

Run site with PHP 8.2

Proposed resolution

Change to (TagService.php lines 88 and 92)

switch ($sort) {
      case 'title':
        usort($tags, static::sortByTitle);
        break;

      case 'count':
        usort($tags, static::sortByCount);
        break;

      case 'random':
        shuffle($tags);
        break;
    }

Remaining tasks

No

User interface changes

No

API changes

No

Data model changes

No

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇮Finland back-2-95 Helsinki

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