From 0fc0904b9409e81041d4d5ae48d699f3360208fc Mon Sep 17 00:00:00 2001
From: "Thibault G." <gattolliat.thibault@gmail.com>
Date: Mon, 14 Apr 2025 15:04:40 +0200
Subject: [PATCH 1/3] fix(metadata): correct class to exclude defaults (#7088)

---
 src/Metadata/Resource/Factory/OperationDefaultsTrait.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Metadata/Resource/Factory/OperationDefaultsTrait.php b/src/Metadata/Resource/Factory/OperationDefaultsTrait.php
index cc7b002d6e..601fd19974 100644
--- a/src/Metadata/Resource/Factory/OperationDefaultsTrait.php
+++ b/src/Metadata/Resource/Factory/OperationDefaultsTrait.php
@@ -16,7 +16,6 @@
 use ApiPlatform\Metadata\ApiResource;
 use ApiPlatform\Metadata\CollectionOperationInterface;
 use ApiPlatform\Metadata\Delete;
-use ApiPlatform\Metadata\Error;
 use ApiPlatform\Metadata\Exception\RuntimeException;
 use ApiPlatform\Metadata\Get;
 use ApiPlatform\Metadata\GetCollection;
@@ -32,6 +31,7 @@
 use ApiPlatform\Metadata\Patch;
 use ApiPlatform\Metadata\Post;
 use ApiPlatform\Metadata\Util\CamelCaseToSnakeCaseNameConverter;
+use ApiPlatform\State\ApiResource\Error;
 use ApiPlatform\State\CreateProvider;
 use ApiPlatform\Validator\Exception\ValidationException;
 use Psr\Log\LoggerInterface;

From 1e6a82a3da8f3ba4ee79ce03518f33445509b294 Mon Sep 17 00:00:00 2001
From: Antoine Bluchet <soyuka@users.noreply.github.com>
Date: Tue, 15 Apr 2025 22:02:28 +0200
Subject: [PATCH 2/3] ci: subtree split deprecations (#7090)

---
 .github/workflows/ci.yml | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0efa1ad2b1..5809559abc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -264,15 +264,19 @@ jobs:
         continue-on-error: true
 
   phpunit-components:
-    name: PHPUnit ${{ matrix.component }} (PHP ${{ matrix.php }})
+    name: PHPUnit ${{ matrix.component }} (PHP ${{ matrix.php.version }} ${{ matrix.php.deprecations && 'no deprecations' || '' }})
     runs-on: ubuntu-latest
     timeout-minutes: 20
     strategy:
       matrix:
         php:
-          - '8.2'
-          - '8.3'
-          - '8.4'
+          - version: '8.2'
+          - version: '8.3'
+          - version: '8.4'
+          - version: '8.4'
+            coverage: true
+          - version: '8.4'
+            deprecations: true
         component:
           - api-platform/doctrine-common
           - api-platform/doctrine-orm
@@ -290,11 +294,6 @@ jobs:
           - api-platform/state
           - api-platform/symfony
           - api-platform/validator
-        include:
-          - php: '8.2'
-          - php: '8.3'
-          - php: '8.4'
-            coverage: true
       fail-fast: false
     steps:
       - name: Checkout
@@ -302,10 +301,13 @@ jobs:
       - name: Setup PHP
         uses: shivammathur/setup-php@v2
         with:
-          php-version: ${{ matrix.php }}
+          php-version: ${{ matrix.php.version }}
           tools: pecl, composer
           extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
           ini-values: memory_limit=-1
+      - name: Allow unstable project dependencies
+        if: matrix.php.deprecations == true
+        run: composer config minimum-stability dev
       - name: Run ${{ matrix.component }} install
         run: |
           composer global require soyuka/pmu
@@ -315,7 +317,7 @@ jobs:
       - name: Run ${{ matrix.component }} tests
         run: |
           mkdir -p /tmp/build/logs/phpunit
-          composer ${{matrix.component}} test --log-junit "/tmp/build/logs/phpunit/junit.xml" ${{ matrix.coverage && '--coverage-clover /tmp/build/logs/phpunit/clover.xml' || '' }}
+          composer ${{matrix.component}} test --log-junit "/tmp/build/logs/phpunit/junit.xml" ${{ matrix.php.coverage && '--coverage-clover /tmp/build/logs/phpunit/clover.xml' || '' }} ${{ matrix.php.deprecations && '--fail-on-deprecation --display-deprecations' || '' }}
       - name: Upload test artifacts
         if: always()
         uses: actions/upload-artifact@v4

From 108d92d7bb300a1ee49c24923a764ab1f89b7dd9 Mon Sep 17 00:00:00 2001
From: Antoine Bluchet <soyuka@users.noreply.github.com>
Date: Wed, 16 Apr 2025 10:06:24 +0200
Subject: [PATCH 3/3] ci: patch phpunit deprecations (#7092)

---
 .github/workflows/ci.yml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5809559abc..a4f606a9ac 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -314,6 +314,9 @@ jobs:
           composer global config allow-plugins.soyuka/pmu true --no-interaction
           composer global link . --permanent
           composer ${{matrix.component}} update
+      - name: Patch phpunit
+        if: matrix.php.deprecations == true
+        run: git apply --directory vendor/phpunit/phpunit .github/patches/phpunit.patch
       - name: Run ${{ matrix.component }} tests
         run: |
           mkdir -p /tmp/build/logs/phpunit