From ff61cd985ca13031f51ebf71f1b22be0af1b3671 Mon Sep 17 00:00:00 2001 From: Darren Fisher <60905-darren.fisher@users.noreply.drupalcode.org> Date: Fri, 3 Jan 2025 12:43:35 +0000 Subject: [PATCH] Attempt to fix further phpcs and phpstan errors. --- core/modules/system/system.module | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/modules/system/system.module b/core/modules/system/system.module index b2293e6ec978..b4c20f11beee 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -6,6 +6,7 @@ use Drupal\Component\FileSecurity\FileSecurity; use Drupal\Core\Access\AccessResult; +use Drupal\Core\Access\AccessResultInterface; use Drupal\Core\Extension\Extension; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemListInterface; @@ -16,6 +17,7 @@ use Drupal\Core\StreamWrapper\LocalStream; use Drupal\Core\StreamWrapper\StreamWrapperManager; use Drupal\Core\Url; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; @@ -548,12 +550,14 @@ function system_page_top(): array { } } } + // Default return value. + return []; } /** * Implements hook_entity_field_access(). */ -function system_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, ?FieldItemListInterface $items = NULL): \Drupal\Core\Access\AccessResultInterface { +function system_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, ?FieldItemListInterface $items = NULL): AccessResultInterface { if ($items) { $entity_type = $items->getEntity()->getEntityType(); if ($entity_type->hasKey('langcode') && $entity_type->getKey('langcode') === $field_definition->getName()) { @@ -566,7 +570,7 @@ function system_entity_field_access($operation, FieldDefinitionInterface $field_ /** * Implements hook_file_download(). */ -function system_file_download($uri): \Symfony\Component\HttpFoundation\Response { +function system_file_download($uri): Response { $stream_wrapper_manager = \Drupal::service('stream_wrapper_manager'); $scheme = $stream_wrapper_manager->getScheme($uri); if ($stream_wrapper_manager->isValidScheme($scheme)) { -- GitLab