From 5b6bd489441311d14856c738b81e77aac0f42441 Mon Sep 17 00:00:00 2001
From: David Levine <david@axepress.dev>
Date: Sat, 6 Apr 2024 09:10:12 +0000
Subject: [PATCH] ci: Test plugin compatibility with PHP 8.2.

---
 .github/workflows/code-quality.yml        |  2 +-
 .github/workflows/code-standard.yml       |  2 +-
 .github/workflows/integration-testing.yml | 28 +++++++++++------------
 .github/workflows/schema-linter.yml       |  2 +-
 CHANGELOG.md                              |  1 +
 README.md                                 |  2 +-
 bin/run-docker.sh                         | 10 ++++----
 docker-compose.yml                        |  4 ++--
 8 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml
index 462d94bf..2f444016 100644
--- a/.github/workflows/code-quality.yml
+++ b/.github/workflows/code-quality.yml
@@ -43,7 +43,7 @@ jobs:
       - name: Setup PHP w/ Composer & WP-CLI
         uses: shivammathur/setup-php@v2
         with:
-          php-version: 8.1
+          php-version: 8.2
           extensions: mbstring, intl, bcmath, exif, gd, mysqli, opcache, zip, pdo_mysql
           tools: composer:v2, wp-cli
           coverage: none
diff --git a/.github/workflows/code-standard.yml b/.github/workflows/code-standard.yml
index dd51e869..53f2871a 100644
--- a/.github/workflows/code-standard.yml
+++ b/.github/workflows/code-standard.yml
@@ -28,7 +28,7 @@ jobs:
       - name: Setup PHP
         uses: shivammathur/setup-php@v2
         with:
-          php-version: 8.1
+          php-version: 8.2
           tools: composer:v2
           coverage: none
 
diff --git a/.github/workflows/integration-testing.yml b/.github/workflows/integration-testing.yml
index 599c60b8..ca1999ef 100644
--- a/.github/workflows/integration-testing.yml
+++ b/.github/workflows/integration-testing.yml
@@ -30,27 +30,27 @@ jobs:
 
     strategy:
       matrix:
-        php: [ '8.0', '7.4' ]
-        wordpress: [ '6.5', '6.4','6.3', '6.2', '6.1', '6.0', '5.9', '5.8', '5.7' ]
+        php: [ '8.2', '8.1', '8.0' ]
+        wordpress: [ '6.5', '6.4','6.3', '6.2', '6.1', '6.0' ]
         include:
-          - php: '8.1'
+          - php: '8.2'
             wordpress: '6.5'
             coverage: 1
-          - php: '8.1'
-            wordpress: '6.4'
-          - php: '8.1'
-            wordpress: '6.3'
-          - php: '8.1'
-            wordpress: '6.2'
-        exclude:
           - php: '7.4'
-            wordpress: '6.5'
+            wordpress: '6.1'
           - php: '7.4'
-            wordpress: '6.4'
+            wordpress: '6.0'
           - php: '7.4'
-            wordpress: '6.3'
+            wordpress: '5.9'
           - php: '7.4'
-            wordpress: '6.2'
+            wordpress: '5.8'
+          - php: '7.4'
+            wordpress: '5.7'
+        exclude:
+          # Old WP versions that dont support newer PHP versions
+          - php: "8.2"
+            wordpress: "6.0"
+          # New WP versions that dont support older PHP versions
           - php: "8.0"
             wordpress: "6.5"
       fail-fast: false
diff --git a/.github/workflows/schema-linter.yml b/.github/workflows/schema-linter.yml
index 64c3cb0f..fb8e7a0d 100644
--- a/.github/workflows/schema-linter.yml
+++ b/.github/workflows/schema-linter.yml
@@ -46,7 +46,7 @@ jobs:
       - name: Setup PHP w/ Composer & WP-CLI
         uses: shivammathur/setup-php@v2
         with:
-          php-version: 8.1
+          php-version: 8.2
           extensions: mbstring, intl, bcmath, exif, gd, mysqli, opcache, zip, pdo_mysql
           coverage: none
           tools: composer:v2, wp-cli
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8914d44e..b07ee3b2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@
 - chore: lock WPBrowser to <3.5.0 to prevent conflicts with Codeception.
 - ci: Update GitHub Actions to latest versions.
 - ci: Test plugin compatibility with WordPress 6.5.0.
+- ci: Test plugin compatibility with PHP 8.2.
 
 ## v0.12.5
 
diff --git a/README.md b/README.md
index 3feb16b6..c764cec9 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ Our hope for this open source project is that it will enable more teams to lever
 
 ## System Requirements
 
-* PHP 7.4-8.1+
+* PHP 7.4-8.2+
 * WordPress 5.4.1+
 * WPGraphQL 1.9.0+
 * Gravity Forms 2.5+ (Recommend: v2.6+)
diff --git a/bin/run-docker.sh b/bin/run-docker.sh
index 7f12bc97..461b8d31 100644
--- a/bin/run-docker.sh
+++ b/bin/run-docker.sh
@@ -16,11 +16,11 @@ print_usage_instructions() {
 	echo "  composer build-app"
 	echo "  composer run-app"
 	echo ""
-	echo "  WP_VERSION=6.5 PHP_VERSION=8.1 composer build-app"
-	echo "  WP_VERSION=6.5 PHP_VERSION=8.1 composer run-app"
+	echo "  WP_VERSION=6.5 PHP_VERSION=8.2 composer build-app"
+	echo "  WP_VERSION=6.5 PHP_VERSION=8.2 composer run-app"
 	echo ""
-	echo "  WP_VERSION=6.5 PHP_VERSION=8.1 bin/run-docker.sh build -a"
-	echo "  WP_VERSION=6.5 PHP_VERSION=8.1 bin/run-docker.sh run -a"
+	echo "  WP_VERSION=6.5 PHP_VERSION=8.2 bin/run-docker.sh build -a"
+	echo "  WP_VERSION=6.5 PHP_VERSION=8.2 bin/run-docker.sh run -a"
 	exit 1
 }
 
@@ -30,7 +30,7 @@ fi
 
 TAG=${TAG-latest}
 WP_VERSION=${WP_VERSION-6.5}
-PHP_VERSION=${PHP_VERSION-8.1}
+PHP_VERSION=${PHP_VERSION-8.2}
 
 BUILD_NO_CACHE=${BUILD_NO_CACHE-}
 
diff --git a/docker-compose.yml b/docker-compose.yml
index cae3dc55..5762d592 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -4,7 +4,7 @@ services:
   app:
     depends_on:
       - app_db
-    image: wp-graphql-gravity-forms:latest-wp${WP_VERSION-6.3}-php${PHP_VERSION-8.1}
+    image: wp-graphql-gravity-forms:latest-wp${WP_VERSION-6.3}-php${PHP_VERSION-8.2}
     volumes:
       - .:/var/www/html/wp-content/plugins/wp-graphql-gravity-forms
       - ./.log/app:/var/log/apache2
@@ -36,7 +36,7 @@ services:
   testing:
     depends_on:
       - app_db
-    image: wp-graphql-gravity-forms-testing:latest-wp${WP_VERSION-6.0}-php${PHP_VERSION-8.1}
+    image: wp-graphql-gravity-forms-testing:latest-wp${WP_VERSION-6.0}-php${PHP_VERSION-8.2}
     volumes:
       - .:/var/www/html/wp-content/plugins/wp-graphql-gravity-forms
       - ./.log/testing:/var/log/apache2