PHP 8.3 deprecations

Created on 8 October 2024, 3 months ago

Problem/Motivation

After upgrading to PHP 8.3 we can see a deprecation warning:

Deprecated function: Calling get_class() without arguments is deprecated in Drupal\Core\Render\ElementInfoManager->Drupal\Core\Render\{closure}() (line 132 of core/lib/Drupal/Core/Render/ElementInfoManager.php).
Drupal\Core\Render\ElementInfoManager->Drupal\Core\Render\{closure}()
get_class() (Line: 25)
Drupal\disqus\Element\Disqus->getInfo() (Line: 137)
Drupal\Core\Render\ElementInfoManager->buildInfo() (Line: 92)
Drupal\Core\Render\ElementInfoManager->getInfo() (Line: 806)
Drupal\Core\Form\FormBuilder->prepareForm() (Line: 285)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult() (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Proposed resolution

Replace:

get_class() . '::generatePlaceholder',

To:

[Disqus::class, 'generatePlaceholder'],
πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡§πŸ‡·Brazil aluzzardi Pelotas, RS

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