diff --git a/core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php b/core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php
index 91efbb75866d484c6727396fc10fdb15d2f9e8d1..c50b832aa72adde6ce7822f664a37d01872ba2a6 100644
--- a/core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php
+++ b/core/tests/Drupal/Tests/Component/Transliteration/PhpTransliterationTest.php
@@ -91,7 +91,7 @@ public static function providerTestPhpTransliterationRemoveDiacritics() {
    *
    * @dataProvider providerTestPhpTransliteration
    */
-  public function testPhpTransliteration($langcode, $original, $expected, $unknown_character = '?', $max_length = NULL) {
+  public function testPhpTransliteration(string $langcode, string $original, string $expected, string $unknown_character = '?', int $max_length = NULL): void {
     $transliterator_class = new PhpTransliteration();
     $actual = $transliterator_class->transliterate($original, $langcode, $unknown_character, $max_length);
     $this->assertSame($expected, $actual);
@@ -104,7 +104,7 @@ public function testPhpTransliteration($langcode, $original, $expected, $unknown
    *   An array of arrays, each containing the parameters for
    *   self::testPhpTransliteration().
    */
-  public function providerTestPhpTransliteration() {
+  public static function providerTestPhpTransliteration(): array {
     $random_generator = new Random();
     $random = $random_generator->string(10);
     // Make some strings with two, three, and four-byte characters for testing.
diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php
index eeef34bc571d1e99626eb5046622fd33045e628e..2da31c9ea94fa29d9ff0cc2beb02a743a10d5da2 100644
--- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php
+++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php
@@ -260,10 +260,10 @@ public function testDrupalDrupalFileWasReplaced() {
   /**
    * Provides test values for testDrupalDrupalFileWasAppended.
    */
-  public function scaffoldAppendTestValues() {
+  public static function scaffoldAppendTestValues(): array {
     return array_merge(
-      $this->scaffoldAppendTestValuesToPermute(FALSE),
-      $this->scaffoldAppendTestValuesToPermute(TRUE),
+      static::scaffoldAppendTestValuesToPermute(FALSE),
+      static::scaffoldAppendTestValuesToPermute(TRUE),
       [
         [
           'drupal-drupal-append-settings',
@@ -286,7 +286,7 @@ public function scaffoldAppendTestValues() {
    * @param bool $is_link
    *   Whether or not symlinking should be used.
    */
-  protected function scaffoldAppendTestValuesToPermute($is_link) {
+  protected static function scaffoldAppendTestValuesToPermute($is_link) {
     return [
       [
         'drupal-drupal-test-append',
@@ -344,7 +344,7 @@ protected function scaffoldAppendTestValuesToPermute($is_link) {
    *
    * @dataProvider scaffoldAppendTestValues
    */
-  public function testDrupalDrupalFileWasAppended($fixture_name, $is_link, $scaffold_file_path, $scaffold_file_contents, $scaffoldOutputContains) {
+  public function testDrupalDrupalFileWasAppended(string $fixture_name, bool $is_link, string $scaffold_file_path, string $scaffold_file_contents, string $scaffoldOutputContains): void {
     $result = $this->scaffoldSut($fixture_name, $is_link, FALSE);
     $this->assertStringContainsString($scaffoldOutputContains, $result->scaffoldOutput());
 
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
index 16fa33ca7a3e9d3ae0809251d9b35b5f7f6f8c10..fffbee4f8f0873eb2dc1e128280f8acba17df8c4 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php
@@ -63,10 +63,8 @@ class ConfigEntityBaseUnitTest extends UnitTestCase {
 
   /**
    * The provider of the entity type.
-   *
-   * @var string
    */
-  protected $provider = 'the_provider_of_the_entity_type';
+  const PROVIDER = 'the_provider_of_the_entity_type';
 
   /**
    * The language manager.
@@ -126,7 +124,7 @@ protected function setUp(): void {
     $this->entityType = $this->createMock('\Drupal\Core\Config\Entity\ConfigEntityTypeInterface');
     $this->entityType->expects($this->any())
       ->method('getProvider')
-      ->willReturn($this->provider);
+      ->willReturn(static::PROVIDER);
     $this->entityType->expects($this->any())
       ->method('getConfigPrefix')
       ->willReturn('test_provider.' . $this->entityTypeId);
@@ -222,11 +220,11 @@ public function testPreSaveDuringSync() {
    */
   public function testAddDependency() {
     $method = new \ReflectionMethod('\Drupal\Core\Config\Entity\ConfigEntityBase', 'addDependency');
-    $method->invoke($this->entity, 'module', $this->provider);
+    $method->invoke($this->entity, 'module', static::PROVIDER);
     $method->invoke($this->entity, 'module', 'core');
     $method->invoke($this->entity, 'module', 'node');
     $dependencies = $this->entity->getDependencies();
-    $this->assertNotContains($this->provider, $dependencies['module']);
+    $this->assertNotContains(static::PROVIDER, $dependencies['module']);
     $this->assertNotContains('core', $dependencies['module']);
     $this->assertContains('node', $dependencies['module']);
 
@@ -247,7 +245,7 @@ public function testAddDependency() {
    *
    * @dataProvider providerCalculateDependenciesWithPluginCollections
    */
-  public function testCalculateDependenciesWithPluginCollections($definition, $expected_dependencies) {
+  public function testCalculateDependenciesWithPluginCollections(array $definition, array $expected_dependencies): void {
     $this->moduleHandler->moduleExists('the_provider_of_the_entity_type')->willReturn(TRUE);
     $this->moduleHandler->moduleExists('test')->willReturn(TRUE);
     $this->moduleHandler->moduleExists('test_theme')->willReturn(FALSE);
@@ -288,7 +286,7 @@ public function testCalculateDependenciesWithPluginCollections($definition, $exp
    *
    * @return array
    */
-  public function providerCalculateDependenciesWithPluginCollections() {
+  public static function providerCalculateDependenciesWithPluginCollections(): array {
     // Start with 'a' so that order of the dependency array is fixed.
     $instance_dependency_1 = 'a' . Random::machineName(10);
     $instance_dependency_2 = 'a' . Random::machineName(11);
@@ -307,7 +305,7 @@ public function providerCalculateDependenciesWithPluginCollections() {
       // Tests that a plugin that is provided by the same module as the config
       // entity is not added to the dependencies array.
       [
-        ['provider' => $this->provider],
+        ['provider' => static::PROVIDER],
         [],
       ],
       // Tests that a config entity that has a plugin which provides config
@@ -337,7 +335,7 @@ public function testCalculateDependenciesWithThirdPartySettings() {
     $this->entity = $this->getMockForAbstractClass('\Drupal\Core\Config\Entity\ConfigEntityBase', [[], $this->entityTypeId]);
     $this->entity->setThirdPartySetting('test_provider', 'test', 'test');
     $this->entity->setThirdPartySetting('test_provider2', 'test', 'test');
-    $this->entity->setThirdPartySetting($this->provider, 'test', 'test');
+    $this->entity->setThirdPartySetting(static::PROVIDER, 'test', 'test');
 
     $this->assertEquals(['test_provider', 'test_provider2'], $this->entity->calculateDependencies()->getDependencies()['module']);
     $changed = $this->entity->onDependencyRemoval(['module' => ['test_provider2']]);
@@ -641,7 +639,7 @@ public function testToArraySchemaException() {
    * @covers ::set
    * @dataProvider providerTestSetAndPreSaveWithPluginCollections
    */
-  public function testSetWithPluginCollections(bool $syncing, string $expected_value) {
+  public function testSetWithPluginCollections(bool $syncing, string $expected_value): void {
     $instance_id = 'the_instance_id';
     $instance = new TestConfigurablePlugin(['foo' => 'original_value'], $instance_id, []);
 
@@ -668,7 +666,7 @@ public function testSetWithPluginCollections(bool $syncing, string $expected_val
    * @covers ::preSave
    * @dataProvider providerTestSetAndPreSaveWithPluginCollections
    */
-  public function testPreSaveWithPluginCollections(bool $syncing, string $expected_value) {
+  public function testPreSaveWithPluginCollections(bool $syncing, string $expected_value): void {
     $instance_id = 'the_instance_id';
     $instance = new TestConfigurablePlugin(['foo' => 'original_value'], $instance_id, ['provider' => 'core']);
 
@@ -709,7 +707,7 @@ public function testPreSaveWithPluginCollections(bool $syncing, string $expected
     $this->assertSame($expected_value, $entity->get('the_plugin_collection_config')[$instance_id]['foo']);
   }
 
-  public function providerTestSetAndPreSaveWithPluginCollections(): array {
+  public static function providerTestSetAndPreSaveWithPluginCollections(): array {
     return [
       'Not syncing' => [FALSE, 'new_value'],
       'Syncing' => [TRUE, 'original_value'],
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php
index daeaecb9297948ad67318e03aa9803e55714a451..bf2ce4b160db174c3c257604630740b8cac7dee8 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php
@@ -254,7 +254,7 @@ public function testGetFormObject() {
    * @return array
    *   Test data.
    */
-  public function provideFormObjectInvalidOperationData(): array {
+  public static function provideFormObjectInvalidOperationData(): array {
     return [
       'missing_form_handler' => [
         'test_entity_type',
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
index 45b38f6a255612058cd2a90bd6be1fb83fba7639..d9278aea237fb2d6256d7f5c948489d167a1fe4c 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
@@ -237,7 +237,7 @@ public function testToUrlLinkTemplateRevision(bool $is_default_revision, string
    * @return array
    *   An array of test cases for testToUrlLinkTemplateRevision().
    */
-  public function providerTestToUrlLinkTemplateRevision(): array {
+  public static function providerTestToUrlLinkTemplateRevision(): array {
     $test_cases = [];
 
     $route_parameters = ['test_entity' => static::ENTITY_ID];
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php b/core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php
index 941455add1080deadc3b1f82aef963240532f77c..526ab7fae7689af4cee8d18c5e975df7baca90cb 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererCallbackTest.php
@@ -27,12 +27,12 @@ protected function setUp(): void {
    *
    * @param array $render_array
    *   The render array with a callback.
-   * @param $expected_deprecation
+   * @param string $expected_deprecation
    *   The expected deprecation message triggered whilst rendering.
    *
    * @dataProvider providerTestCallback
    */
-  public function testCallback(array $render_array, $expected_deprecation) {
+  public function testCallback(array $render_array, string $expected_deprecation): void {
     $this->expectException(UntrustedCallbackException::class);
     $this->expectExceptionMessage($expected_deprecation);
     $this->renderer->renderRoot($render_array);
@@ -41,7 +41,7 @@ public function testCallback(array $render_array, $expected_deprecation) {
   /**
    * Data provider for testCallback().
    */
-  public function providerTestCallback() {
+  public static function providerTestCallback(): array {
     return [
       'Procedural function pre render' => [
         // We specifically test an untrusted callback here. We need to let
@@ -61,7 +61,7 @@ public function providerTestCallback() {
         // We specifically test an invalid callback here. We need to let PHPStan
         // ignore it.
         // @phpstan-ignore-next-line
-        ['#access_callback' => [$this, 'renderCallback'], '#type' => 'container'],
+        ['#access_callback' => [new static('test'), 'renderCallback'], '#type' => 'container'],
         'Render #access_callback callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was Drupal\Tests\Core\Render\RendererCallbackTest::renderCallback. See https://www.drupal.org/node/2966725',
       ],
       'Procedural function lazy builder' => [
@@ -72,7 +72,7 @@ public function providerTestCallback() {
         'Render #lazy_builder callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was \Drupal\Tests\Core\Render\callback. See https://www.drupal.org/node/2966725',
       ],
       'Invokable object access callback' => [
-        ['#access_callback' => $this, '#type' => 'container'],
+        ['#access_callback' => new static('test'), '#type' => 'container'],
         'Render #access_callback callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was Drupal\Tests\Core\Render\RendererCallbackTest. See https://www.drupal.org/node/2966725',
       ],
     ];
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php b/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
index 1933101ea4d01fae4af8dc8f36a603041be8872e..7f06ce447dbaa0f13931a896f97c891fc9e6203e 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
@@ -61,8 +61,8 @@ protected function setUp(): void {
    *
    * @return array
    */
-  public function providerPlaceholders() {
-    $args = [$this->randomContextValue()];
+  public static function providerPlaceholders(): array {
+    $args = [static::randomContextValue()];
 
     $generate_placeholder_markup = function ($cache_keys = NULL) use ($args) {
       $token_render_array = [
@@ -471,7 +471,7 @@ public function providerPlaceholders() {
     // - uncacheable
     $x = $base_element_b;
     $expected_placeholder_render_array = $x['#attached']['placeholders'][(string) $generate_placeholder_markup()];
-    $this->assertArrayNotHasKey('#cache', $expected_placeholder_render_array);
+    self::assertArrayNotHasKey('#cache', $expected_placeholder_render_array);
     $cases[] = [
       $x,
       $args,
@@ -529,7 +529,7 @@ public function providerPlaceholders() {
    *   - The context used for that #lazy_builder callback.
    */
   protected function generatePlaceholderElement() {
-    $args = [$this->randomContextValue()];
+    $args = [static::randomContextValue()];
     $test_element = [];
     $test_element['#attached']['drupalSettings']['foo'] = 'bar';
     $test_element['placeholder']['#cache']['keys'] = ['placeholder', 'output', 'can', 'be', 'render', 'cached', 'too'];
@@ -562,7 +562,7 @@ protected function assertPlaceholderRenderCache($cache_keys, array $expected_dat
    *
    * @dataProvider providerPlaceholders
    */
-  public function testUncacheableParent($element, $args, array $expected_placeholder_render_array, $placeholder_cache_keys, array $bubbled_cache_contexts, array $bubbled_cache_tags, array $placeholder_expected_render_cache_array) {
+  public function testUncacheableParent(array $element, array $args, array $expected_placeholder_render_array, array|false $placeholder_cache_keys, array $bubbled_cache_contexts, array $bubbled_cache_tags, array $placeholder_expected_render_cache_array): void {
     if ($placeholder_cache_keys) {
       $this->setupMemoryCache();
     }
@@ -593,7 +593,7 @@ public function testUncacheableParent($element, $args, array $expected_placehold
    *
    * @dataProvider providerPlaceholders
    */
-  public function testCacheableParent($test_element, $args, array $expected_placeholder_render_array, $placeholder_cache_keys, array $bubbled_cache_contexts, array $bubbled_cache_tags, array $placeholder_expected_render_cache_array) {
+  public function testCacheableParent(array $test_element, array $args, array $expected_placeholder_render_array, array|false $placeholder_cache_keys, array $bubbled_cache_contexts, array $bubbled_cache_tags, array $placeholder_expected_render_cache_array): void {
     $element = $test_element;
     $this->setupMemoryCache();
 
@@ -726,7 +726,7 @@ public function testCacheableParent($test_element, $args, array $expected_placeh
    *
    * @dataProvider providerPlaceholders
    */
-  public function testCacheableParentWithPostRequest($test_element, $args) {
+  public function testCacheableParentWithPostRequest(array $test_element, array $args): void {
     $this->setUpUnusedCache();
 
     // Verify behavior when handling a non-GET request, e.g. a POST request:
@@ -762,7 +762,7 @@ public function testCacheableParentWithPostRequest($test_element, $args) {
    *
    * @dataProvider providerPlaceholders
    */
-  public function testPlaceholderingDisabledForPostRequests($test_element, $args) {
+  public function testPlaceholderingDisabledForPostRequests(array $test_element, array $args): void {
     $this->setUpUnusedCache();
     $this->setUpRequest('POST');
 
@@ -797,7 +797,7 @@ public function testPlaceholderingDisabledForPostRequests($test_element, $args)
    * @covers ::replacePlaceholders
    */
   public function testRecursivePlaceholder() {
-    $args = [$this->randomContextValue()];
+    $args = [static::randomContextValue()];
     $element = [];
     $element['#create_placeholder'] = TRUE;
     $element['#lazy_builder'] = ['Drupal\Tests\Core\Render\RecursivePlaceholdersTest::callback', $args];
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php b/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
index 8e1b76cc878b0b47a1d7f08c39287873728cc817..a7489a7704523bb576640e5fe37fea1ab9292a11 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
@@ -216,7 +216,7 @@ protected function setUp(): void {
    * @see PlaceholdersTest::callback()
    * @see https://www.drupal.org/node/2151609
    */
-  protected function randomContextValue() {
+  protected static function randomContextValue(): string {
     $tokens = ['llama', 'alpaca', 'camel', 'moose', 'elk'];
     return $tokens[mt_rand(0, 4)];
   }
diff --git a/core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php b/core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php
index 3eeb8c36e0691c5a879010282ca9188972ab6671..92e5b705e55c0fd83dbd7bc199aa9a915d78ad92 100644
--- a/core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php
@@ -5,6 +5,7 @@
 namespace Drupal\Tests\Core\Routing;
 
 use Drupal\Core\Routing\CurrentRouteMatch;
+use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Routing\RouteObjectInterface;
 use Symfony\Component\HttpFoundation\InputBag;
 use Symfony\Component\HttpFoundation\ParameterBag;
@@ -21,7 +22,7 @@ class CurrentRouteMatchTest extends RouteMatchTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function getRouteMatch($name, Route $route, array $parameters, array $raw_parameters) {
+  protected static function getRouteMatch(string $name, Route $route, array $parameters, array $raw_parameters): RouteMatchInterface {
     $request_stack = new RequestStack();
     $request = new Request();
     $request_stack->push($request);
diff --git a/core/tests/Drupal/Tests/Core/Routing/RouteMatchTest.php b/core/tests/Drupal/Tests/Core/Routing/RouteMatchTest.php
index c86fa3f110504df65b044305396bf51ed8fb2097..47ebf10829e1555363bef620fc955880da1d33a1 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RouteMatchTest.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RouteMatchTest.php
@@ -5,6 +5,7 @@
 namespace Drupal\Tests\Core\Routing;
 
 use Drupal\Core\Routing\RouteMatch;
+use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Routing\RouteObjectInterface;
 use Symfony\Component\HttpFoundation\InputBag;
 use Symfony\Component\HttpFoundation\Request;
@@ -19,7 +20,7 @@ class RouteMatchTest extends RouteMatchTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function getRouteMatch($name, Route $route, array $parameters, array $raw_parameters) {
+  protected static function getRouteMatch(string $name, Route $route, array $parameters, array $raw_parameters): RouteMatchInterface {
     return new RouteMatch($name, $route, $parameters, $raw_parameters);
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Routing/RouteMatchTestBase.php b/core/tests/Drupal/Tests/Core/Routing/RouteMatchTestBase.php
index 3cb1866f85bb7a96459d95a57ddfd5029f5c8223..8fffba927ecb2845d971e1f65ad0400b37aa9d81 100644
--- a/core/tests/Drupal/Tests/Core/Routing/RouteMatchTestBase.php
+++ b/core/tests/Drupal/Tests/Core/Routing/RouteMatchTestBase.php
@@ -18,23 +18,23 @@ abstract class RouteMatchTestBase extends UnitTestCase {
   /**
    * Build a test route match object for the given implementation.
    *
-   * @param $name
+   * @param string $name
    *   Route name.
    * @param \Symfony\Component\Routing\Route $route
    *   Request object
    * @param array $parameters
    *   Parameters array
-   * @param $raw_parameters
+   * @param array $raw_parameters
    *   Raw parameters array
    *
    * @return \Drupal\Core\Routing\RouteMatchInterface
    */
-  abstract protected function getRouteMatch($name, Route $route, array $parameters, array $raw_parameters);
+  abstract protected static function getRouteMatch(string $name, Route $route, array $parameters, array $raw_parameters): RouteMatchInterface;
 
   /**
    * Provide sets of parameters and expected parameters for parameter tests.
    */
-  public function routeMatchProvider() {
+  public static function routeMatchProvider(): array {
     $base_data = [
       [
         new Route(
@@ -70,7 +70,7 @@ public function routeMatchProvider() {
       $params = $entry[1];
       $expected_params = $entry[2];
       $data[] = [
-        $this->getRouteMatch('test_route', $route, $params, $params),
+        static::getRouteMatch('test_route', $route, $params, $params),
         $route,
         $params,
         $expected_params,
@@ -84,7 +84,7 @@ public function routeMatchProvider() {
    * @covers ::getRouteName
    * @dataProvider routeMatchProvider
    */
-  public function testGetRouteName(RouteMatchInterface $route_match) {
+  public function testGetRouteName(RouteMatchInterface $route_match): void {
     $this->assertSame('test_route', $route_match->getRouteName());
   }
 
@@ -92,7 +92,7 @@ public function testGetRouteName(RouteMatchInterface $route_match) {
    * @covers ::getRouteObject
    * @dataProvider routeMatchProvider
    */
-  public function testGetRouteObject(RouteMatchInterface $route_match, Route $route) {
+  public function testGetRouteObject(RouteMatchInterface $route_match, Route $route): void {
     $this->assertSame($route, $route_match->getRouteObject());
   }
 
@@ -101,7 +101,7 @@ public function testGetRouteObject(RouteMatchInterface $route_match, Route $rout
    * @covers \Drupal\Core\Routing\RouteMatch::getParameterNames
    * @dataProvider routeMatchProvider
    */
-  public function testGetParameter(RouteMatchInterface $route_match, Route $route, $parameters, $expected_filtered_parameters) {
+  public function testGetParameter(RouteMatchInterface $route_match, Route $route, array $parameters, array $expected_filtered_parameters): void {
     foreach ($expected_filtered_parameters as $name => $expected_value) {
       $this->assertSame($expected_value, $route_match->getParameter($name));
     }
@@ -115,7 +115,7 @@ public function testGetParameter(RouteMatchInterface $route_match, Route $route,
    * @covers \Drupal\Core\Routing\RouteMatch::getParameterNames
    * @dataProvider routeMatchProvider
    */
-  public function testGetParameters(RouteMatchInterface $route_match, Route $route, $parameters, $expected_filtered_parameters) {
+  public function testGetParameters(RouteMatchInterface $route_match, Route $route, array $parameters, array $expected_filtered_parameters): void {
     $this->assertSame($expected_filtered_parameters, $route_match->getParameters()->all());
   }
 
@@ -124,7 +124,7 @@ public function testGetParameters(RouteMatchInterface $route_match, Route $route
    * @covers \Drupal\Core\Routing\RouteMatch::getParameterNames
    * @dataProvider routeMatchProvider
    */
-  public function testGetRawParameter(RouteMatchInterface $route_match, Route $route, $parameters, $expected_filtered_parameters) {
+  public function testGetRawParameter(RouteMatchInterface $route_match, Route $route, array $parameters, array $expected_filtered_parameters): void {
     foreach ($expected_filtered_parameters as $name => $expected_value) {
       $this->assertSame($expected_value, $route_match->getRawParameter($name));
     }
@@ -138,7 +138,7 @@ public function testGetRawParameter(RouteMatchInterface $route_match, Route $rou
    * @covers \Drupal\Core\Routing\RouteMatch::getParameterNames
    * @dataProvider routeMatchProvider
    */
-  public function testGetRawParameters(RouteMatchInterface $route_match, Route $route, $parameters, $expected_filtered_parameters) {
+  public function testGetRawParameters(RouteMatchInterface $route_match, Route $route, array $parameters, array $expected_filtered_parameters): void {
     $this->assertSame($expected_filtered_parameters, $route_match->getRawParameters()->all());
   }