Issue #3351004 by Natallia: Deprecations for PHP 8.1 get_class() and get_called_class() without argument

(cherry picked from commit decf4529d1)
merge-requests/3234/head
catch 2023-03-29 15:27:25 +01:00
parent 72afac7e1c
commit d6cdd674dc
4 changed files with 5 additions and 5 deletions

View File

@ -57,7 +57,7 @@ class NormalInstallerServiceProvider implements ServiceProviderInterface {
$container->getDefinition('extension.list.theme_engine')->setClass(InstallerThemeEngineExtensionList::class);
// Don't register the lazy route provider in the super early installer.
if (get_called_class() === NormalInstallerServiceProvider::class) {
if (static::class === NormalInstallerServiceProvider::class) {
$lazy_route_provider = $container->register('router.route_provider.installer');
$lazy_route_provider
->setClass(InstallerRouteProviderLazyBuilder::class)

View File

@ -30,7 +30,7 @@ class StatusMessages extends RenderElement {
// of that specific type.
'#display' => NULL,
'#pre_render' => [
get_class() . '::generatePlaceholder',
self::class . '::generatePlaceholder',
],
'#include_fallback' => FALSE,
];
@ -47,7 +47,7 @@ class StatusMessages extends RenderElement {
*/
public static function generatePlaceholder(array $element) {
$build = [
'#lazy_builder' => [get_class() . '::renderMessages', [$element['#display']]],
'#lazy_builder' => [self::class . '::renderMessages', [$element['#display']]],
'#create_placeholder' => TRUE,
];

View File

@ -777,7 +777,7 @@ class Url implements TrustedCallbackInterface {
'#options' => $this->getOptions(),
];
if (!$this->unrouted) {
$render_array['#access_callback'] = [get_class(), 'renderAccess'];
$render_array['#access_callback'] = [self::class, 'renderAccess'];
}
return $render_array;
}

View File

@ -85,7 +85,7 @@ class SystemMenuBlock extends BlockBase implements ContainerFactoryPluginInterfa
'#title' => $this->t('Menu levels'),
// Open if not set to defaults.
'#open' => $defaults['level'] !== $config['level'] || $defaults['depth'] !== $config['depth'],
'#process' => [[get_class(), 'processMenuLevelParents']],
'#process' => [[self::class, 'processMenuLevelParents']],
];
$options = range(0, $this->menuTree->maxDepth());