Deprecations for PHP 8.1 get_class() and get_called_class() without argument

Created on 29 March 2023, over 1 year ago

Problem/Motivation

In scope of PHP8.1 compatibility static analysis it was discovered some deprecations in Drupal Core codebase:
1. 60 docroot/core/lib/Drupal/Core/Installer/NormalInstallerServiceProvider.php get_called_class() without argument
2. 33, 50 docroot/core/lib/Drupal/Core/Render/Element/StatusMessages.php get_class() without argument
3. 88 docroot/core/modules/system/src/Plugin/Block/SystemMenuBlock.php get_class() without argument
4. 780 docroot/core/lib/Drupal/Core/Url.php get_class() without argument

Proposed resolution

According to https://wiki.php.net/rfc/deprecations_php_8_1 remove argument-less get_class() and get_called_class() usage in favor of the dedicated self::class, parent::class and static::class syntax.

📌 Task
Status

Fixed

Version

9.5

Component
Base  →

Last updated 1 day ago

Created by

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024