From 7cbdf08fce60e8c1a256b6ef0d03a64a7b8bb44f Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Thu, 12 Oct 2023 09:12:32 +0100
Subject: [PATCH] Issue #2916306 by TR, quietone, pfrenssen: Use "@return"
 instead of "@returns"

---
 .../Drupal/Core/Form/EnforcedResponseException.php |  2 +-
 core/lib/Drupal/Core/Render/Renderer.php           |  2 +-
 .../Drupal/Core/Session/SessionConfiguration.php   |  4 ++--
 .../src/ContentTranslationManagerInterface.php     |  2 +-
 .../src/FieldTranslationSynchronizer.php           |  2 +-
 .../ResourceType/ResourceTypeRepositoryTest.php    |  4 ++--
 .../migrate/src/Plugin/MigrationInterface.php      |  2 +-
 .../page_cache/src/StackMiddleware/PageCache.php   |  9 +++++----
 .../src/Normalizer/DateTimeNormalizer.php          |  2 +-
 .../router_test_directory/src/TestContent.php      |  2 +-
 .../views/src/Plugin/views/field/EntityLink.php    |  2 +-
 .../Drupal/Tests/Component/Datetime/TimeTest.php   |  4 ++--
 .../Tests/Core/Asset/JsOptimizerUnitTest.php       |  4 ++--
 .../Core/Entity/ContentEntityBaseUnitTest.php      |  4 ++--
 .../Core/Session/SessionConfigurationTest.php      | 14 +++++++-------
 15 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/core/lib/Drupal/Core/Form/EnforcedResponseException.php b/core/lib/Drupal/Core/Form/EnforcedResponseException.php
index 73649845eb46..ca3b8b8688e1 100644
--- a/core/lib/Drupal/Core/Form/EnforcedResponseException.php
+++ b/core/lib/Drupal/Core/Form/EnforcedResponseException.php
@@ -37,7 +37,7 @@ public function __construct(Response $response, $message = "", $code = 0, \Excep
   /**
    * Return the response to be enforced.
    *
-   * @returns \Symfony\Component\HttpFoundation\Response $response
+   * @return \Symfony\Component\HttpFoundation\Response
    *   The response to be enforced.
    */
   public function getResponse() {
diff --git a/core/lib/Drupal/Core/Render/Renderer.php b/core/lib/Drupal/Core/Render/Renderer.php
index 5d794f451787..8097d84d7479 100644
--- a/core/lib/Drupal/Core/Render/Renderer.php
+++ b/core/lib/Drupal/Core/Render/Renderer.php
@@ -641,7 +641,7 @@ protected function setCurrentRenderContext(RenderContext $context = NULL) {
    *   bubbleable metadata associated with the markup that replaced the
    *   placeholders.
    *
-   * @returns bool
+   * @return bool
    *   Whether placeholders were replaced.
    *
    * @see \Drupal\Core\Render\Renderer::renderPlaceholder()
diff --git a/core/lib/Drupal/Core/Session/SessionConfiguration.php b/core/lib/Drupal/Core/Session/SessionConfiguration.php
index 2687ac94b614..d1e5de1d934e 100644
--- a/core/lib/Drupal/Core/Session/SessionConfiguration.php
+++ b/core/lib/Drupal/Core/Session/SessionConfiguration.php
@@ -82,7 +82,7 @@ protected function getName(Request $request) {
    * @param \Symfony\Component\HttpFoundation\Request $request
    *   The request.
    *
-   * @returns string
+   * @return string
    *   The session name without the prefix (SESS/SSESS).
    */
   protected function getUnprefixedName(Request $request) {
@@ -118,7 +118,7 @@ protected function getUnprefixedName(Request $request) {
    * @param \Symfony\Component\HttpFoundation\Request $request
    *   The request.
    *
-   * @returns string|null
+   * @return string|null
    *   The session cookie domain, or NULL if the calculated value is invalid.
    */
   protected function getCookieDomain(Request $request) {
diff --git a/core/modules/content_translation/src/ContentTranslationManagerInterface.php b/core/modules/content_translation/src/ContentTranslationManagerInterface.php
index 1852026126cd..1b36b077342b 100644
--- a/core/modules/content_translation/src/ContentTranslationManagerInterface.php
+++ b/core/modules/content_translation/src/ContentTranslationManagerInterface.php
@@ -71,7 +71,7 @@ public function setEnabled($entity_type_id, $bundle, $value);
    *   (optional) The bundle of the entity. If no bundle is provided, all the
    *   available bundles are checked.
    *
-   * @returns bool
+   * @return bool
    *   TRUE if the specified bundle is translatable. If no bundle is provided
    *   returns TRUE if at least one of the entity bundles is translatable.
    */
diff --git a/core/modules/content_translation/src/FieldTranslationSynchronizer.php b/core/modules/content_translation/src/FieldTranslationSynchronizer.php
index 336909d2a7e8..0bd8e2c6d833 100644
--- a/core/modules/content_translation/src/FieldTranslationSynchronizer.php
+++ b/core/modules/content_translation/src/FieldTranslationSynchronizer.php
@@ -327,7 +327,7 @@ protected function createMergedItem(array $source_item, array $target_item, arra
    * @param array $properties
    *   An array of column names to be synchronized.
    *
-   * @returns string
+   * @return string
    *   A hash code that can be used to identify the item.
    */
   protected function itemHash(array $items, $delta, array $properties) {
diff --git a/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php b/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php
index e7d5216e5c5e..88c60f7203cf 100644
--- a/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php
+++ b/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php
@@ -90,7 +90,7 @@ public function testGet($entity_type_id, $bundle, $entity_class) {
   /**
    * Data provider for testGet.
    *
-   * @returns array
+   * @return array
    *   The data for the test method.
    */
   public function getProvider() {
@@ -137,7 +137,7 @@ public function testMappingNameConflictCheck($field_name_list) {
    * mapping: the special-cased names "type" or "id", and the name
    * "{$entity_type_id}_type" or "{$entity_type_id}_id", respectively.
    *
-   * @returns array
+   * @return array
    *   The data for the test method.
    */
   public function getFieldsProvider() {
diff --git a/core/modules/migrate/src/Plugin/MigrationInterface.php b/core/modules/migrate/src/Plugin/MigrationInterface.php
index 7936485997b7..132582852d7c 100644
--- a/core/modules/migrate/src/Plugin/MigrationInterface.php
+++ b/core/modules/migrate/src/Plugin/MigrationInterface.php
@@ -106,7 +106,7 @@ public function label();
   /**
    * Get a list of required plugin IDs.
    *
-   * @returns string[]
+   * @return string[]
    */
   public function getRequirements(): array;
 
diff --git a/core/modules/page_cache/src/StackMiddleware/PageCache.php b/core/modules/page_cache/src/StackMiddleware/PageCache.php
index 05a70187e1ad..07456a40976d 100644
--- a/core/modules/page_cache/src/StackMiddleware/PageCache.php
+++ b/core/modules/page_cache/src/StackMiddleware/PageCache.php
@@ -99,7 +99,7 @@ public function handle(Request $request, $type = self::MAIN_REQUEST, $catch = TR
    * @param bool $catch
    *   Whether to catch exceptions or not
    *
-   * @returns \Symfony\Component\HttpFoundation\Response $response
+   * @return \Symfony\Component\HttpFoundation\Response
    *   A response object.
    */
   protected function pass(Request $request, $type = self::MAIN_REQUEST, $catch = TRUE) {
@@ -117,7 +117,7 @@ protected function pass(Request $request, $type = self::MAIN_REQUEST, $catch = T
    * @param bool $catch
    *   Whether to catch exceptions or not
    *
-   * @returns \Symfony\Component\HttpFoundation\Response $response
+   * @return \Symfony\Component\HttpFoundation\Response
    *   A response object.
    */
   protected function lookup(Request $request, $type = self::MAIN_REQUEST, $catch = TRUE) {
@@ -183,7 +183,7 @@ protected function lookup(Request $request, $type = self::MAIN_REQUEST, $catch =
    * @param bool $catch
    *   Whether to catch exceptions or not
    *
-   * @returns \Symfony\Component\HttpFoundation\Response $response
+   * @return \Symfony\Component\HttpFoundation\Response
    *   A response object.
    */
   protected function fetch(Request $request, $type = self::MAIN_REQUEST, $catch = TRUE) {
@@ -207,7 +207,8 @@ protected function fetch(Request $request, $type = self::MAIN_REQUEST, $catch =
    * @param \Symfony\Component\HttpFoundation\Response $response
    *   A response object that should be stored in the page cache.
    *
-   * @returns bool
+   * @return bool
+   *   TRUE if the response has been stored successfully, FALSE otherwise.
    */
   protected function storeResponse(Request $request, Response $response) {
     // Drupal's primary cache invalidation architecture is cache tags: any
diff --git a/core/modules/serialization/src/Normalizer/DateTimeNormalizer.php b/core/modules/serialization/src/Normalizer/DateTimeNormalizer.php
index c1fdf1fb1834..83ffe156fe6e 100644
--- a/core/modules/serialization/src/Normalizer/DateTimeNormalizer.php
+++ b/core/modules/serialization/src/Normalizer/DateTimeNormalizer.php
@@ -69,7 +69,7 @@ public function normalize($datetime, $format = NULL, array $context = []): array
    * @see ::normalize
    * @see \Drupal\Core\Datetime\DrupalDateTime::prepareTimezone()
    *
-   * @returns \DateTimeZone
+   * @return \DateTimeZone
    *   The timezone to use.
    */
   protected function getNormalizationTimezone() {
diff --git a/core/modules/system/tests/modules/router_test_directory/src/TestContent.php b/core/modules/system/tests/modules/router_test_directory/src/TestContent.php
index 7f4166078b0e..38ec6982ed12 100644
--- a/core/modules/system/tests/modules/router_test_directory/src/TestContent.php
+++ b/core/modules/system/tests/modules/router_test_directory/src/TestContent.php
@@ -44,7 +44,7 @@ public function test1() {
   /**
    * Provides example content for route specific authentication.
    *
-   * @returns string
+   * @return string
    *   The user name of the current logged in user.
    */
   public function test11() {
diff --git a/core/modules/views/src/Plugin/views/field/EntityLink.php b/core/modules/views/src/Plugin/views/field/EntityLink.php
index 3ebe91a109cb..b96d1d445cc5 100644
--- a/core/modules/views/src/Plugin/views/field/EntityLink.php
+++ b/core/modules/views/src/Plugin/views/field/EntityLink.php
@@ -50,7 +50,7 @@ protected function getUrlInfo(ResultRow $row) {
   /**
    * Returns the entity link template name identifying the link route.
    *
-   * @returns string
+   * @return string
    *   The link template name.
    */
   protected function getEntityLinkTemplate() {
diff --git a/core/tests/Drupal/Tests/Component/Datetime/TimeTest.php b/core/tests/Drupal/Tests/Component/Datetime/TimeTest.php
index 98dc0e6b53d8..83c5a3e86ad2 100644
--- a/core/tests/Drupal/Tests/Component/Datetime/TimeTest.php
+++ b/core/tests/Drupal/Tests/Component/Datetime/TimeTest.php
@@ -128,7 +128,7 @@ public function testGetCurrentMicroTime() {
 /**
  * Shadow time() system call.
  *
- * @returns int
+ * @return int
  */
 function time() {
   return 12345678;
@@ -137,7 +137,7 @@ function time() {
 /**
  * Shadow microtime system call.
  *
- * @returns float
+ * @return float
  */
 function microtime() {
   return 1234567.89;
diff --git a/core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php
index 3c4623ab228f..cc2596566c77 100644
--- a/core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php
@@ -33,7 +33,7 @@ protected function setUp(): void {
    *
    * @see \Drupal\Core\Asset\JsOptimizer::clean()
    *
-   * @returns array
+   * @return array
    *   An array of test data.
    */
   public function providerTestClean() {
@@ -80,7 +80,7 @@ public function testClean($js_asset, $expected) {
    *
    * @see \Drupal\Core\Asset\JsOptimizer::optimize()
    *
-   * @returns array
+   * @return array
    *   An array of test data.
    */
   public function providerTestOptimize() {
diff --git a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
index 5da25e326fb6..8b75f404e715 100644
--- a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
@@ -526,7 +526,7 @@ public function testAccess() {
   /**
    * Data provider for testGet().
    *
-   * @returns
+   * @return array
    *   - Expected output from get().
    *   - Field name parameter to get().
    *   - Language code for $activeLanguage.
@@ -586,7 +586,7 @@ public function testGet($expected, $field_name, $active_langcode, $fields) {
   /**
    * Data provider for testGetFields().
    *
-   * @returns array
+   * @return array
    *   - Expected output from getFields().
    *   - $include_computed value to pass to getFields().
    *   - Value to mock from all field definitions for isComputed().
diff --git a/core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php b/core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php
index 55282c05483c..3c6508806ca0 100644
--- a/core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php
@@ -14,7 +14,7 @@ class SessionConfigurationTest extends UnitTestCase {
   /**
    * Constructs a partially mocked SUT.
    *
-   * @returns \Drupal\Core\Session\SessionConfiguration|\PHPUnit\Framework\MockObject\MockObject
+   * @return \Drupal\Core\Session\SessionConfiguration|\PHPUnit\Framework\MockObject\MockObject
    */
   protected function createSessionConfiguration($options = []) {
     return $this->getMockBuilder('Drupal\Core\Session\SessionConfiguration')
@@ -42,7 +42,7 @@ public function testGeneratedCookieDomain($uri, $expected_domain) {
   /**
    * Data provider for the cookie domain test.
    *
-   * @returns array
+   * @return array
    *   Test data
    */
   public function providerTestGeneratedCookieDomain() {
@@ -81,7 +81,7 @@ public function testEnforcedCookieDomain($uri, $expected_domain) {
   /**
    * Data provider for the cookie domain test.
    *
-   * @returns array
+   * @return array
    *   Test data
    */
   public function providerTestEnforcedCookieDomain() {
@@ -147,7 +147,7 @@ public function testCookieSecureNotOverridable($uri, $expected_secure) {
   /**
    * Data provider for the cookie secure test.
    *
-   * @returns array
+   * @return array
    *   Test data
    */
   public function providerTestCookieSecure() {
@@ -180,7 +180,7 @@ public function testGeneratedSessionName($uri, $expected_name) {
   /**
    * Data provider for the cookie name test.
    *
-   * @returns array
+   * @return array
    *   Test data
    */
   public function providerTestGeneratedSessionName() {
@@ -228,7 +228,7 @@ public function testEnforcedSessionNameViaCookieDomain($uri, $expected_name) {
   /**
    * Data provider for the cookie name test.
    *
-   * @returns array
+   * @return array
    *   Test data
    */
   public function providerTestEnforcedSessionName() {
@@ -274,7 +274,7 @@ public function testConstructorDefaultSettings(array $options, int $expected_sid
   /**
    * Data provider for the constructor test.
    *
-   * @returns array
+   * @return array
    *   Test data
    */
   public function providerTestConstructorDefaultSettings() {
-- 
GitLab