diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index 08224671..e30814ee 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -54,6 +54,9 @@ jobs: - '8.3' - '7.4' include: + # Latest WordPress on PHP 8.5 + - wp: '6.8' + php: '8.5' # Latest WordPress on PHP 8.4 - wp: '6.8' php: '8.4' diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 1aac71ad..82b94142 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -44,6 +44,7 @@ jobs: label: - 'PHP' php: + - '8.5' - '8.4' fail-fast: false with: diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 6b012b5e..7a240eb4 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -55,6 +55,9 @@ jobs: - '8.3' - '7.4' include: + # Latest WordPress on PHP 8.5 + - wp: '6.8' + php: '8.5' # Latest WordPress on PHP 8.4 - wp: '6.8' php: '8.4' diff --git a/classes/Collector_Assets.php b/classes/Collector_Assets.php index 3d1039b6..cfc0a069 100644 --- a/classes/Collector_Assets.php +++ b/classes/Collector_Assets.php @@ -283,13 +283,13 @@ protected static function get_script_modules(): ?array { $reflector = new ReflectionClass( $modules ); $get_marked_for_enqueue = $reflector->getMethod( 'get_marked_for_enqueue' ); - $get_marked_for_enqueue->setAccessible( true ); + ( \PHP_VERSION_ID < 80100 ) && $get_marked_for_enqueue->setAccessible( true ); $get_dependencies = $reflector->getMethod( 'get_dependencies' ); - $get_dependencies->setAccessible( true ); + ( \PHP_VERSION_ID < 80100 ) && $get_dependencies->setAccessible( true ); $get_src = $reflector->getMethod( 'get_src' ); - $get_src->setAccessible( true ); + ( \PHP_VERSION_ID < 80100 ) && $get_src->setAccessible( true ); /** * @var array> $enqueued @@ -365,9 +365,9 @@ protected static function get_script_modules(): ?array { } // @todo check isPrivate before changing visibility back - $get_marked_for_enqueue->setAccessible( false ); - $get_dependencies->setAccessible( false ); - $get_src->setAccessible( false ); + ( \PHP_VERSION_ID < 80100 ) && $get_marked_for_enqueue->setAccessible( false ); + ( \PHP_VERSION_ID < 80100 ) && $get_dependencies->setAccessible( false ); + ( \PHP_VERSION_ID < 80100 ) && $get_src->setAccessible( false ); return $sources; }