
| Current Path : /var/www/html/store/web/core/lib/Drupal/Core/DependencyInjection/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/store/web/core/lib/Drupal/Core/DependencyInjection/DeprecatedServicePropertyTrait.php |
<?php
namespace Drupal\Core\DependencyInjection;
/**
* Provides a standard way to announce deprecated properties.
*/
trait DeprecatedServicePropertyTrait {
/**
* Allows to access deprecated/removed properties.
*
* This method must be public.
*/
public function __get($name) {
if (!isset($this->deprecatedProperties)) {
throw new \LogicException('The deprecatedProperties property must be defined to use this trait.');
}
if (isset($this->deprecatedProperties[$name])) {
$service_name = $this->deprecatedProperties[$name];
$class_name = static::class;
@trigger_error("The property $name ($service_name service) is deprecated in $class_name and will be removed before Drupal 11.0.0.", E_USER_DEPRECATED);
return \Drupal::service($service_name);
}
}
}