Issue #3480029 by kim.pepper, mstrelan: Add return typehint to \Drupal\Core\DependencyInjection\DeprecatedServicePropertyTrait::__get()

merge-requests/8590/merge
Dave Long 2024-11-02 22:51:05 +00:00
parent 5a87e35f8f
commit 63f216f389
No known key found for this signature in database
GPG Key ID: ED52AE211E142771
2 changed files with 3 additions and 19 deletions

View File

@ -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\\.$#',

View File

@ -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;
}
}