diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php index 7cce357cc46..ffdd7c6113d 100644 --- a/core/.phpstan-baseline.php +++ b/core/.phpstan-baseline.php @@ -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\\.$#', diff --git a/core/lib/Drupal/Core/DependencyInjection/DeprecatedServicePropertyTrait.php b/core/lib/Drupal/Core/DependencyInjection/DeprecatedServicePropertyTrait.php index 8f70555323c..ba81fac98be 100644 --- a/core/lib/Drupal/Core/DependencyInjection/DeprecatedServicePropertyTrait.php +++ b/core/lib/Drupal/Core/DependencyInjection/DeprecatedServicePropertyTrait.php @@ -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; } }