From cc3673f1110d70e7bee52a5385759576ac69ba6f Mon Sep 17 00:00:00 2001
From: catch <6915-catch@users.noreply.drupalcode.org>
Date: Fri, 14 Feb 2025 10:53:17 +0000
Subject: [PATCH] Issue #3503741 by quietone, smustgrave: Fix
 'Drupal.Commenting.VariableComment.MissingVar' in core/tests

---
 core/phpcs.xml.dist                                  |  1 +
 .../FunctionalTests/Asset/AssetOptimizationTest.php  |  2 ++
 .../FunctionalTests/Asset/UnversionedAssetTest.php   |  2 ++
 .../InstallerExistingConfigNoProfileTest.php         |  2 +-
 .../Installer/InstallerExistingConfigTestBase.php    |  6 ++----
 .../KernelTests/Core/Action/DeleteActionTest.php     |  2 ++
 .../KernelTests/Core/Plugin/PluginTestBase.php       | 12 ++++++++++++
 .../Drupal/KernelTests/Core/Theme/RegistryTest.php   |  2 ++
 .../Drupal/Tests/Component/Annotation/PluginTest.php |  2 ++
 .../PhpStorage/MTimeProtectedFastFileStorageTest.php |  4 ++++
 .../PhpStorage/MTimeProtectedFileStorageTest.php     |  4 ++++
 .../Composer/Plugin/Scaffold/ScaffoldTestResult.php  |  4 ++++
 .../Core/Asset/LibraryDiscoveryCollectorTest.php     |  2 ++
 .../Tests/Core/Asset/LibraryDiscoveryParserTest.php  |  2 ++
 core/tests/Drupal/Tests/Core/Common/TagsTest.php     |  2 ++
 .../Core/Config/Entity/ConfigEntityBaseUnitTest.php  |  4 ++++
 .../Tests/Core/Controller/ControllerResolverTest.php |  2 ++
 .../KeyValueStore/KeyValueEntityStorageTest.php      | 10 ++++++++++
 .../Drupal/Tests/Core/Entity/StubEntityBase.php      |  8 ++++++++
 .../Tests/Core/Extension/GenericTestExistsTest.php   |  2 ++
 .../Tests/Core/Form/ConfigFormBaseTraitTest.php      |  2 ++
 .../Drupal/Tests/Core/Logger/LoggerChannelTest.php   |  4 ++++
 core/tests/Drupal/Tests/Core/Menu/MenuLinkMock.php   |  2 ++
 .../Core/Plugin/FilteredPluginManagerTraitTest.php   |  8 ++++++++
 .../Tests/Core/Plugin/PluginDependencyTraitTest.php  |  4 ++++
 core/tests/Drupal/Tests/Core/Render/RendererTest.php |  2 ++
 .../Tests/Core/Render/TestCacheableDependency.php    |  2 +-
 .../Tests/Core/Session/AccessPolicyProcessorTest.php |  2 ++
 .../Drupal/Tests/Core/Template/TwigExtensionTest.php |  2 ++
 .../Tests/Core/Utility/CallableResolverTest.php      |  2 ++
 .../Drupal/Tests/Core/Utility/LinkGeneratorTest.php  |  2 ++
 core/tests/Drupal/Tests/PerformanceData.php          |  2 ++
 core/tests/Drupal/Tests/StreamCapturer.php           |  2 ++
 33 files changed, 105 insertions(+), 6 deletions(-)

diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist
index 4b42c73f4873..6825b266d661 100644
--- a/core/phpcs.xml.dist
+++ b/core/phpcs.xml.dist
@@ -106,6 +106,7 @@
   <rule ref="Drupal.Commenting.VariableComment.MissingVar">
     <include-pattern>core/modules/*/tests/*</include-pattern>
     <include-pattern>core/profiles/*/tests/*</include-pattern>
+    <include-pattern>core/tests/*</include-pattern>
   </rule>
   <rule ref="Drupal.ControlStructures.ControlSignature"/>
   <rule ref="Drupal.ControlStructures.ElseIf"/>
diff --git a/core/tests/Drupal/FunctionalTests/Asset/AssetOptimizationTest.php b/core/tests/Drupal/FunctionalTests/Asset/AssetOptimizationTest.php
index 0b298f2175ec..96980a2c6059 100644
--- a/core/tests/Drupal/FunctionalTests/Asset/AssetOptimizationTest.php
+++ b/core/tests/Drupal/FunctionalTests/Asset/AssetOptimizationTest.php
@@ -23,6 +23,8 @@ class AssetOptimizationTest extends BrowserTestBase {
 
   /**
    * The file assets path settings value.
+   *
+   * @var string
    */
   protected $fileAssetsPath;
 
diff --git a/core/tests/Drupal/FunctionalTests/Asset/UnversionedAssetTest.php b/core/tests/Drupal/FunctionalTests/Asset/UnversionedAssetTest.php
index 558803657a29..a2f84544ff59 100644
--- a/core/tests/Drupal/FunctionalTests/Asset/UnversionedAssetTest.php
+++ b/core/tests/Drupal/FunctionalTests/Asset/UnversionedAssetTest.php
@@ -20,6 +20,8 @@ class UnversionedAssetTest extends BrowserTestBase {
 
   /**
    * The file assets path settings value.
+   *
+   * @var string
    */
   protected $fileAssetsPath;
 
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoProfileTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoProfileTest.php
index e10cb2910fec..ea4f70e3a6c6 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoProfileTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoProfileTest.php
@@ -12,7 +12,7 @@
 class InstallerExistingConfigNoProfileTest extends InstallerExistingConfigTest {
 
   /**
-   * Tests the install from config without a profile.
+   * {@inheritdoc}
    */
   protected $profile = FALSE;
 
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php
index ec98efd802f3..fc820e53ab30 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php
@@ -21,14 +21,12 @@
 abstract class InstallerExistingConfigTestBase extends InstallerTestBase {
 
   /**
-   * This is set by the profile in the core.extension extracted.
-   *
-   * If set to FALSE, then the install will proceed without an install profile.
+   * {@inheritdoc}
    */
   protected $profile = NULL;
 
   /**
-   * @todo Fill out docblock.
+   * @var bool
    */
   protected $existingSyncDirectory = FALSE;
 
diff --git a/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php b/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php
index 35cda2bb5c04..0302ec72da36 100644
--- a/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php
@@ -17,6 +17,8 @@ class DeleteActionTest extends KernelTestBase {
 
   /**
    * The test user.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
    */
   protected $testUser;
 
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php b/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php
index a6f8dda1ca0d..fcac2ff73aef 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php
@@ -24,31 +24,43 @@ abstract class PluginTestBase extends KernelTestBase {
 
   /**
    * The test plugin manager used by Plugin API unit tests.
+   *
+   * @var \Drupal\plugin_test\Plugin\TestPluginManager
    */
   protected $testPluginManager;
 
   /**
    * The expected plugin definitions for the test plugin.
+   *
+   * @var array
    */
   protected $testPluginExpectedDefinitions;
 
   /**
    * The mock plugin manager used by Plugin API derivative unit tests.
+   *
+   * @var \Drupal\plugin_test\Plugin\MockBlockManager
    */
   protected $mockBlockManager;
 
   /**
    * The expected plugin definitions for the mock block plugin.
+   *
+   * @var array
    */
   protected $mockBlockExpectedDefinitions;
 
   /**
    * The default plugin manager used by Plugin API unit tests.
+   *
+   * @var \Drupal\plugin_test\Plugin\DefaultsTestPluginManager
    */
   protected $defaultsTestPluginManager;
 
   /**
    * The expected plugin definitions for the defaults plugin.
+   *
+   * @var array
    */
   protected $defaultsTestPluginExpectedDefinitions;
 
diff --git a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
index 687925101a06..e3896c733b5a 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php
@@ -26,6 +26,8 @@ class RegistryTest extends KernelTestBase {
 
   /**
    * The profile to use for this test.
+   *
+   * @var string
    */
   protected $profile = 'testing';
 
diff --git a/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php b/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php
index dd2db0b7253c..ad02c2ddba47 100644
--- a/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php
+++ b/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php
@@ -100,6 +100,8 @@ class PluginStub extends Plugin {
 
   /**
    * A default property for testing.
+   *
+   * @var string
    */
   protected $defaultProperty = 'test_value';
 
diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFastFileStorageTest.php b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFastFileStorageTest.php
index 222ca9031bf0..6e65e0ca8dde 100644
--- a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFastFileStorageTest.php
+++ b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFastFileStorageTest.php
@@ -20,11 +20,15 @@ class MTimeProtectedFastFileStorageTest extends MTimeProtectedFileStorageBase {
    * The first iteration does not change the directory mtime so this class will
    * include the hacked file on the first try but the second test will change
    * the directory mtime and so on the second try the file will not be included.
+   *
+   * @var bool[]
    */
   protected array $expected = [TRUE, FALSE];
 
   /**
    * The PHP storage class to test.
+   *
+   * @var class-string
    */
   protected $storageClass = 'Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage';
 
diff --git a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php
index ef3b0ac478ad..0abed0e1233d 100644
--- a/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php
+++ b/core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageTest.php
@@ -19,11 +19,15 @@ class MTimeProtectedFileStorageTest extends MTimeProtectedFileStorageBase {
    *
    * The default implementation protects against even the filemtime change so
    * both iterations will return FALSE.
+   *
+   * @var bool[]
    */
   protected array $expected = [FALSE, FALSE];
 
   /**
    * The PHP storage class to test.
+   *
+   * @var class-string
    */
   protected $storageClass = 'Drupal\Component\PhpStorage\MTimeProtectedFileStorage';
 
diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ScaffoldTestResult.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ScaffoldTestResult.php
index f44c12ce1d94..f474e95074c2 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ScaffoldTestResult.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ScaffoldTestResult.php
@@ -11,11 +11,15 @@ class ScaffoldTestResult {
 
   /**
    * The location of the scaffold fixture.
+   *
+   * @var string
    */
   protected $docroot;
 
   /**
    * The stdout from the test.
+   *
+   * @var string
    */
   protected $scaffoldOutput;
 
diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php
index 7d1566d9ff92..8e15bd49741c 100644
--- a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php
@@ -85,6 +85,8 @@ class LibraryDiscoveryCollectorTest extends UnitTestCase {
 
   /**
    * The active theme.
+   *
+   * @var \Drupal\Core\Theme\ActiveTheme|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $activeTheme;
 
diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php
index 991f7d389daf..96a114e5bf1c 100644
--- a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php
@@ -871,6 +871,8 @@ class TestLibraryDiscoveryParser extends LibraryDiscoveryParser {
 
   /**
    * The valid URIs.
+   *
+   * @var array
    */
   protected $validUris;
 
diff --git a/core/tests/Drupal/Tests/Core/Common/TagsTest.php b/core/tests/Drupal/Tests/Core/Common/TagsTest.php
index 11f1dc17616e..cb8084365bb8 100644
--- a/core/tests/Drupal/Tests/Core/Common/TagsTest.php
+++ b/core/tests/Drupal/Tests/Core/Common/TagsTest.php
@@ -18,6 +18,8 @@ class TagsTest extends UnitTestCase {
 
   /**
    * A list of valid tags.
+   *
+   * @var string[][]
    */
   protected $validTags = [
     'Drupal' => 'Drupal',
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
index f876e75ad33f..03f1059d1826 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
@@ -724,11 +724,15 @@ class TestConfigEntityWithPluginCollections extends ConfigEntityBaseWithPluginCo
 
   /**
    * The plugin collection.
+   *
+   * @var \Drupal\Core\Plugin\DefaultLazyPluginCollection
    */
   protected $pluginCollection;
 
   /**
    * The plugin manager.
+   *
+   * @var \Drupal\Component\Plugin\PluginManagerInterface|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $pluginManager;
 
diff --git a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
index a89e2a6f73a5..18934e5d49ff 100644
--- a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php
@@ -208,6 +208,8 @@ class MockContainerInjection implements ContainerInjectionInterface {
 
   /**
    * The test value saved during construction.
+   *
+   * @var string
    */
   protected $result;
 
diff --git a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
index ee289906b91e..e82cd6885cbc 100644
--- a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
@@ -638,26 +638,36 @@ class EntityBaseTest extends EntityBase {
 
   /**
    * The entity ID.
+   *
+   * @var string
    */
   public $id;
 
   /**
    * The language code for the entity.
+   *
+   * @var string
    */
   public $langcode;
 
   /**
    * The entity UUID.
+   *
+   * @var string
    */
   public $uuid;
 
   /**
    * The entity label.
+   *
+   * @var string
    */
   public $label;
 
   /**
    * The original, or NULL if the entity cannot be loaded.
+   *
+   * @var string
    */
   public $original;
 
diff --git a/core/tests/Drupal/Tests/Core/Entity/StubEntityBase.php b/core/tests/Drupal/Tests/Core/Entity/StubEntityBase.php
index dce32a895865..1fe7b543ba7f 100644
--- a/core/tests/Drupal/Tests/Core/Entity/StubEntityBase.php
+++ b/core/tests/Drupal/Tests/Core/Entity/StubEntityBase.php
@@ -13,22 +13,30 @@ class StubEntityBase extends EntityBase {
 
   /**
    * The ID for the stub entity.
+   *
+   * @var string
    */
   public $id;
 
   /**
    * The language code for the stub entity.
+   *
+   * @var string
    */
 
   public $langcode;
 
   /**
    * The UUID for the stub entity.
+   *
+   * @var string
    */
   public $uuid;
 
   /**
    * The label for the stub entity.
+   *
+   * @var string
    */
   public $label;
 
diff --git a/core/tests/Drupal/Tests/Core/Extension/GenericTestExistsTest.php b/core/tests/Drupal/Tests/Core/Extension/GenericTestExistsTest.php
index fb540f943375..488108a1aa88 100644
--- a/core/tests/Drupal/Tests/Core/Extension/GenericTestExistsTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/GenericTestExistsTest.php
@@ -18,6 +18,8 @@ class GenericTestExistsTest extends UnitTestCase {
 
   /**
    * Lists module that do not require a Generic test.
+   *
+   * @var string[]
    */
   protected $modulesNoTest = ['help_topics', 'sdc'];
 
diff --git a/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php b/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php
index 292d9ff7991c..a1111cf5b456 100644
--- a/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php
@@ -74,6 +74,8 @@ class ConfiguredTrait {
 
   /**
    * The configuration factory.
+   *
+   * @var null
    */
   public $configFactory;
 
diff --git a/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php b/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php
index 31f2f417cbf9..c8f8b2593aa3 100644
--- a/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php
+++ b/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php
@@ -190,11 +190,15 @@ class NaughtyRecursiveLogger implements LoggerInterface {
 
   /**
    * The logger channel.
+   *
+   * @var \Drupal\Core\Logger\LoggerChannel
    */
   protected $channel;
 
   /**
    * The message to log.
+   *
+   * @var string|\Stringable
    */
   protected $message;
 
diff --git a/core/tests/Drupal/Tests/Core/Menu/MenuLinkMock.php b/core/tests/Drupal/Tests/Core/Menu/MenuLinkMock.php
index fa49a1f2001d..2275ef3ffe11 100644
--- a/core/tests/Drupal/Tests/Core/Menu/MenuLinkMock.php
+++ b/core/tests/Drupal/Tests/Core/Menu/MenuLinkMock.php
@@ -14,6 +14,8 @@ class MenuLinkMock extends MenuLinkBase {
 
   /**
    * The default configuration for the test menu link.
+   *
+   * @var array
    */
   protected static $defaults = [
     'menu_name' => 'mock',
diff --git a/core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php b/core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php
index df45f38aeed9..28a8da4dce9c 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php
@@ -87,21 +87,29 @@ class TestFilteredPluginManager extends PluginManagerBase implements FilteredPlu
 
   /**
    * An array of plugin definitions.
+   *
+   * @var array
    */
   protected $definitions = [];
 
   /**
    * The module handler.
+   *
+   * @var Drupal\Core\Extension\ModuleHandlerInterface
    */
   protected $moduleHandler;
 
   /**
    * The theme manager.
+   *
+   * @var Drupal\Core\Theme\ThemeManagerInterface
    */
   protected $themeManager;
 
   /**
    * The context handler.
+   *
+   * @var Drupal\Core\Plugin\Context\ContextHandlerInterface
    */
   protected $contextHandler;
 
diff --git a/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php b/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php
index c881b25fbd53..41976c89e00c 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php
@@ -179,11 +179,15 @@ class TestPluginDependency {
 
   /**
    * The module handler.
+   *
+   * @var Drupal\Core\Extension\ModuleHandlerInterface
    */
   protected $moduleHandler;
 
   /**
    * The theme handler.
+   *
+   * @var Drupal\Core\Extension\ThemeHandlerInterface
    */
   protected $themeHandler;
 
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererTest.php b/core/tests/Drupal/Tests/Core/Render/RendererTest.php
index 751b80e735f6..b08e2910c092 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererTest.php
@@ -26,6 +26,8 @@ class RendererTest extends RendererTestBase {
 
   /**
    * The expected theme variables.
+   *
+   * @var array
    */
   protected $defaultThemeVars = [
     '#cache' => [
diff --git a/core/tests/Drupal/Tests/Core/Render/TestCacheableDependency.php b/core/tests/Drupal/Tests/Core/Render/TestCacheableDependency.php
index 8465899488a1..d576ba8856e7 100644
--- a/core/tests/Drupal/Tests/Core/Render/TestCacheableDependency.php
+++ b/core/tests/Drupal/Tests/Core/Render/TestCacheableDependency.php
@@ -24,7 +24,7 @@ class TestCacheableDependency implements CacheableDependencyInterface {
   /**
    * The cache maximum age.
    */
-  protected $maxAge;
+  protected int $maxAge;
 
   public function __construct(array $contexts, array $tags, $max_age) {
     $this->contexts = $contexts;
diff --git a/core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php b/core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
index b42de0512345..75e0e4f90bf9 100644
--- a/core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
@@ -552,6 +552,8 @@ class CacheItem {
 
   /**
    * The cache data.
+   *
+   * @var \Drupal\Core\Session\CalculatedPermissions
    */
   public $data;
 
diff --git a/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php b/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php
index 4167fa4a30ee..158c8749239c 100644
--- a/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php
+++ b/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php
@@ -679,6 +679,8 @@ class TwigExtensionTestString {
 
   /**
    * The test string.
+   *
+   * @var string
    */
   protected $string;
 
diff --git a/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php b/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php
index bb340b609918..95f710a343ff 100644
--- a/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php
@@ -215,6 +215,8 @@ class MockContainerInjection implements ContainerInjectionInterface {
 
   /**
    * The value to be injected.
+   *
+   * @var string
    */
   protected $injected;
 
diff --git a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
index 67afbed60bfb..4a6c9e93470b 100644
--- a/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
@@ -60,6 +60,8 @@ class LinkGeneratorTest extends UnitTestCase {
 
   /**
    * Contains the LinkGenerator default options.
+   *
+   * @var array
    */
   protected $defaultOptions = [
     'query' => [],
diff --git a/core/tests/Drupal/Tests/PerformanceData.php b/core/tests/Drupal/Tests/PerformanceData.php
index e26c31b939ca..dad60e1be352 100644
--- a/core/tests/Drupal/Tests/PerformanceData.php
+++ b/core/tests/Drupal/Tests/PerformanceData.php
@@ -87,6 +87,8 @@ class PerformanceData {
 
   /**
    * The original return value.
+   *
+   * @var mixed
    */
   protected $returnValue;
 
diff --git a/core/tests/Drupal/Tests/StreamCapturer.php b/core/tests/Drupal/Tests/StreamCapturer.php
index 86bfec396653..3cf37572a1ec 100644
--- a/core/tests/Drupal/Tests/StreamCapturer.php
+++ b/core/tests/Drupal/Tests/StreamCapturer.php
@@ -13,6 +13,8 @@ class StreamCapturer extends \php_user_filter {
 
   /**
    * The cache data.
+   *
+   * @var string
    */
   public static $cache = '';
 
-- 
GitLab