From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Mon, 20 May 2024 11:35:47 +0200
Subject: Make provider functions static (PHPUnit 11 Fix)

Bug-Debian: https://bugs.debian.org/1070504
---
 tests/Composer/Test/Advisory/AuditorTest.php               | 4 ++--
 tests/Composer/Test/Command/BaseDependencyCommandTest.php  | 2 +-
 tests/Composer/Test/Command/InstallCommandTest.php         | 2 +-
 tests/Composer/Test/Command/ReinstallCommandTest.php       | 2 +-
 tests/Composer/Test/Command/RequireCommandTest.php         | 2 +-
 tests/Composer/Test/Command/SelfUpdateCommandTest.php      | 2 +-
 tests/Composer/Test/Command/ShowCommandTest.php            | 4 ++--
 tests/Composer/Test/Command/UpdateCommandTest.php          | 2 +-
 tests/Composer/Test/Json/ComposerSchemaTest.php            | 2 +-
 tests/Composer/Test/Package/Version/VersionGuesserTest.php | 2 +-
 10 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/tests/Composer/Test/Advisory/AuditorTest.php b/tests/Composer/Test/Advisory/AuditorTest.php
index a5472f0..42e0c0c 100644
--- a/tests/Composer/Test/Advisory/AuditorTest.php
+++ b/tests/Composer/Test/Advisory/AuditorTest.php
@@ -200,7 +200,7 @@ Found 2 abandoned packages:
         self::assertSame($output, trim(str_replace("\r", '', $io->getOutput())));
     }
 
-    public function ignoredIdsProvider(): \Generator
+    public static function ignoredIdsProvider(): \Generator
     {
         yield 'ignore by CVE' => [
             [
@@ -353,7 +353,7 @@ Found 2 abandoned packages:
         self::assertSame($exitCode, $result);
     }
 
-    public function ignoreSeverityProvider(): \Generator
+    public static function ignoreSeverityProvider(): \Generator
     {
         yield 'ignore medium' => [
             [
diff --git a/tests/Composer/Test/Command/BaseDependencyCommandTest.php b/tests/Composer/Test/Command/BaseDependencyCommandTest.php
index bc85d18..120e244 100644
--- a/tests/Composer/Test/Command/BaseDependencyCommandTest.php
+++ b/tests/Composer/Test/Command/BaseDependencyCommandTest.php
@@ -440,7 +440,7 @@ OUTPUT
     /**
      * @return Generator<string, array{array<string, string>, string}>
      */
-    public function caseWhyNotProvider(): Generator
+    public static function caseWhyNotProvider(): Generator
     {
         yield 'it could not found the package with a specific version' => [
             ['package' => 'vendor1/package1', 'version' => '3.*'],
diff --git a/tests/Composer/Test/Command/InstallCommandTest.php b/tests/Composer/Test/Command/InstallCommandTest.php
index ebaf15c..33c1a36 100644
--- a/tests/Composer/Test/Command/InstallCommandTest.php
+++ b/tests/Composer/Test/Command/InstallCommandTest.php
@@ -45,7 +45,7 @@ class InstallCommandTest extends TestCase
         self::assertSame(trim($expected), trim($appTester->getDisplay(true)));
     }
 
-    public function errorCaseProvider(): Generator
+    public static function errorCaseProvider(): Generator
     {
         yield 'it writes an error when the dev flag is passed' => [
             [
diff --git a/tests/Composer/Test/Command/ReinstallCommandTest.php b/tests/Composer/Test/Command/ReinstallCommandTest.php
index cc21ce5..4eacb68 100644
--- a/tests/Composer/Test/Command/ReinstallCommandTest.php
+++ b/tests/Composer/Test/Command/ReinstallCommandTest.php
@@ -57,7 +57,7 @@ class ReinstallCommandTest extends TestCase
         self::assertSame($expected, trim($appTester->getDisplay(true)));
     }
 
-    public function caseProvider(): Generator
+    public static function caseProvider(): Generator
     {
         yield 'reinstall a package by name' => [
             ['packages' => ['root/req', 'root/anotherreq*']],
diff --git a/tests/Composer/Test/Command/RequireCommandTest.php b/tests/Composer/Test/Command/RequireCommandTest.php
index 0170061..bb5870f 100644
--- a/tests/Composer/Test/Command/RequireCommandTest.php
+++ b/tests/Composer/Test/Command/RequireCommandTest.php
@@ -327,7 +327,7 @@ OUTPUT
         self::assertArrayNotHasKey($currentKey, $composer_content);
     }
 
-    public function provideInconsistentRequireKeys(): \Generator
+    public static function provideInconsistentRequireKeys(): \Generator
     {
         yield [
             true,
diff --git a/tests/Composer/Test/Command/SelfUpdateCommandTest.php b/tests/Composer/Test/Command/SelfUpdateCommandTest.php
index 3d2341c..b0589b2 100644
--- a/tests/Composer/Test/Command/SelfUpdateCommandTest.php
+++ b/tests/Composer/Test/Command/SelfUpdateCommandTest.php
@@ -87,7 +87,7 @@ class SelfUpdateCommandTest extends TestCase
     /**
      * @return array<array<string>>
      */
-    public function channelOptions(): array
+    public static function channelOptions(): array
     {
         return [
             ['--stable', 'stable channel'],
diff --git a/tests/Composer/Test/Command/ShowCommandTest.php b/tests/Composer/Test/Command/ShowCommandTest.php
index 4ce75a9..700e730 100644
--- a/tests/Composer/Test/Command/ShowCommandTest.php
+++ b/tests/Composer/Test/Command/ShowCommandTest.php
@@ -756,7 +756,7 @@ OUTPUT;
         $appTester->run(['command' => 'show', 'package' => $package] + $options);
     }
 
-    public function provideNotExistingPackage(): \Generator
+    public static function provideNotExistingPackage(): \Generator
     {
         yield 'package with no options' => [
             'not/existing',
@@ -819,7 +819,7 @@ OUTPUT;
         self::assertSame($expected, trim($appTester->getDisplay(true)));
     }
 
-    public function providePackageAndTree(): \Generator
+    public static function providePackageAndTree(): \Generator
     {
         yield 'just package' => [
             function () {
diff --git a/tests/Composer/Test/Command/UpdateCommandTest.php b/tests/Composer/Test/Command/UpdateCommandTest.php
index c00e49e..facbba9 100644
--- a/tests/Composer/Test/Command/UpdateCommandTest.php
+++ b/tests/Composer/Test/Command/UpdateCommandTest.php
@@ -388,7 +388,7 @@ OUTPUT;
         );
     }
 
-    public function provideInteractiveUpdates(): \Generator
+    public static function provideInteractiveUpdates(): \Generator
     {
         yield [
             ['dep/pkg' => '1.0.1'],
diff --git a/tests/Composer/Test/Json/ComposerSchemaTest.php b/tests/Composer/Test/Json/ComposerSchemaTest.php
index 8f479f8..b67d4d2 100644
--- a/tests/Composer/Test/Json/ComposerSchemaTest.php
+++ b/tests/Composer/Test/Json/ComposerSchemaTest.php
@@ -42,7 +42,7 @@ class ComposerSchemaTest extends TestCase
         self::assertEquals($expectedError, $this->check($json));
     }
 
-    public function versionProvider(): array
+    public static function versionProvider(): array
     {
         return [
             ['1.0.0', true],
diff --git a/tests/Composer/Test/Package/Version/VersionGuesserTest.php b/tests/Composer/Test/Package/Version/VersionGuesserTest.php
index 9dc29a2..6b465cd4 100644
--- a/tests/Composer/Test/Package/Version/VersionGuesserTest.php
+++ b/tests/Composer/Test/Package/Version/VersionGuesserTest.php
@@ -381,7 +381,7 @@ class VersionGuesserTest extends TestCase
     /**
      * @return array<array{string, string}>
      */
-    public function rootEnvVersionsProvider(): array
+    public static function rootEnvVersionsProvider(): array
     {
         return [
             ['1.0-dev', '1.0.x-dev'],
