Issue #3480029 by kim.pepper, mstrelan: Add return typehint to \Drupal\Core\DependencyInjection\DeprecatedServicePropertyTrait::__get()
parent
5a87e35f8f
commit
63f216f389
|
@ -8274,12 +8274,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/lib/Drupal/Core/Field/WidgetBaseInterface.php',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Method Drupal\\\\Core\\\\File\\\\FileSystem\\:\\:__get\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/lib/Drupal/Core/File/FileSystem.php',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Method Drupal\\\\Core\\\\File\\\\FileSystem\\:\\:basename\\(\\) has no return type specified\\.$#',
|
||||
|
@ -50391,12 +50385,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/user/src/Plugin/rest/resource/UserRegistrationResource.php',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Method Drupal\\\\user\\\\Plugin\\\\views\\\\access\\\\Permission\\:\\:__get\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/user/src/Plugin/views/access/Permission.php',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Method Drupal\\\\user\\\\Plugin\\\\views\\\\access\\\\Permission\\:\\:alterRouteDefinition\\(\\) has no return type specified\\.$#',
|
||||
|
@ -50601,12 +50589,6 @@ $ignoreErrors[] = [
|
|||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/user/src/Plugin/views/filter/Name.php',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Method Drupal\\\\user\\\\Plugin\\\\views\\\\filter\\\\Permissions\\:\\:__get\\(\\) has no return type specified\\.$#',
|
||||
'count' => 1,
|
||||
'path' => __DIR__ . '/modules/user/src/Plugin/views/filter/Permissions.php',
|
||||
];
|
||||
$ignoreErrors[] = [
|
||||
// identifier: missingType.return
|
||||
'message' => '#^Method Drupal\\\\user\\\\Plugin\\\\views\\\\filter\\\\Permissions\\:\\:query\\(\\) has no return type specified\\.$#',
|
||||
|
|
|
@ -12,7 +12,7 @@ trait DeprecatedServicePropertyTrait {
|
|||
*
|
||||
* This method must be public.
|
||||
*/
|
||||
public function __get($name) {
|
||||
public function __get(string $name): mixed {
|
||||
if (!isset($this->deprecatedProperties)) {
|
||||
throw new \LogicException('The deprecatedProperties property must be defined to use this trait.');
|
||||
}
|
||||
|
@ -24,6 +24,8 @@ trait DeprecatedServicePropertyTrait {
|
|||
@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);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue