diff --git a/core/tests/Drupal/Tests/ComposerIntegrationTest.php b/core/tests/Drupal/Tests/ComposerIntegrationTest.php
index 017aec0815eb1c9c8d569797d117351af11555f8..6f9fa84b634aba09c9403360078bac1f0694aa02 100644
--- a/core/tests/Drupal/Tests/ComposerIntegrationTest.php
+++ b/core/tests/Drupal/Tests/ComposerIntegrationTest.php
@@ -52,7 +52,7 @@ public function testComposerLockHash() {
    *
    * @dataProvider providerTestComposerJson
    */
-  public function testComposerTilde($path) {
+  public function testComposerTilde(string $path): void {
     if (str_ends_with($path, 'composer/Metapackage/CoreRecommended/composer.json')) {
       $this->markTestSkipped("$path has tilde");
     }
@@ -78,9 +78,9 @@ public function testComposerTilde($path) {
    *
    * @return array
    */
-  public function providerTestComposerJson() {
+  public static function providerTestComposerJson(): array {
     $data = [];
-    $composer_json_finder = $this->getComposerJsonFinder(realpath(__DIR__ . '/../../../../'));
+    $composer_json_finder = self::getComposerJsonFinder(realpath(__DIR__ . '/../../../../'));
     foreach ($composer_json_finder->getIterator() as $composer_json) {
       $data[$composer_json->getPathname()] = [$composer_json->getPathname()];
     }