diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index ace30b8ae..7f3c0b5a3 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -16,16 +16,12 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.1', '8.2', '8.3'] + php-version: ['8.2', '8.3', '8.4'] experimental: [false] composer_args: [""] include: - - php-version: 8.4 - experimental: false - composer_args: "--ignore-platform-reqs" - php-version: 8.5 experimental: true - composer_args: "--ignore-platform-reqs" env: extensions: ast, grpc, opentelemetry, protobuf @@ -177,5 +173,5 @@ jobs: needs: php with: matrix_extension: '["ast, json, grpc"]' - matrix_php_version: '["8.1", "8.2", "8.3"]' + matrix_php_version: '["8.2", "8.3", "8.4", "8.5"]' install_directory: '~/.test/.packages' diff --git a/.github/workflows/publish-otel-php-base-docker-image.yml b/.github/workflows/publish-otel-php-base-docker-image.yml index cfa675a80..5d11dfe41 100644 --- a/.github/workflows/publish-otel-php-base-docker-image.yml +++ b/.github/workflows/publish-otel-php-base-docker-image.yml @@ -18,7 +18,7 @@ jobs: name: OpenTelemetry PHP base docker image creation strategy: matrix: - php-version: ['8.1', '8.2', '8.3', '8.4'] + php-version: ['8.2', '8.3', '8.4', '8.5'] runs-on: ubuntu-latest permissions: packages: write diff --git a/.phan/config.php b/.phan/config.php index 139407d12..abd828f63 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -44,7 +44,7 @@ // // Note that the **only** effect of choosing `'5.6'` is to infer that functions removed in php 7.0 exist. // (See `backward_compatibility_checks` for additional options) - 'target_php_version' => '8.1', + 'target_php_version' => '8.2', // If enabled, missing properties will be created when // they are first seen. If false, we'll report an diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1bc4e266b..e31eda298 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,8 +13,8 @@ To contribute effectively, ensure you have the following tools installed: * PHP 8.1 or higher (Check supported PHP versions) We aim to support officially supported PHP versions, according to https://www.php.net/supported-versions.php. The -developer image `ghcr.io/open-telemetry/opentelemetry-php/opentelemetry-php-base` is tagged as `8.1`, `8.2` and `8.3` -respectively, with `8.1` being the default. You can execute the test suite against other PHP versions by running the +developer image `ghcr.io/open-telemetry/opentelemetry-php/opentelemetry-php-base` is tagged as `8.2`, `8.3` and `8.4` +respectively, with `8.2` being the default. You can execute the test suite against other PHP versions by running the following command: ```bash diff --git a/Makefile b/Makefile index 1ff4d1483..34346fe3a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ include .env -PHP_VERSION ?= 8.1 +PHP_VERSION ?= 8.2 DOCKER_COMPOSE ?= docker compose DC_RUN_PHP = $(DOCKER_COMPOSE) run --rm php diff --git a/composer.json b/composer.json index 3d1241a47..cc883b7c8 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "readme": "./README.md", "license": "Apache-2.0", "require": { - "php": "^8.1", + "php": "^8.2", "google/protobuf": "^3.22 || ^4.0", "nyholm/psr7-server": "^1.1", "php-http/discovery": "^1.14", @@ -19,7 +19,6 @@ "ramsey/uuid": "^3.0 || ^4.0", "symfony/config": "^5.4 || ^6.4 || ^7.0 || ^8.0", "symfony/polyfill-mbstring": "^1.23", - "symfony/polyfill-php82": "^1.26", "symfony/polyfill-php83": "^1.32", "symfony/polyfill-php84": "^1.32", "tbachert/spi": "^1.0.x-dev" diff --git a/docker/Dockerfile b/docker/Dockerfile index acc31ca1c..18ff6973c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -15,28 +15,35 @@ RUN apt-get update && apt-get install -y lsb-release apt-transport-https ca-cert ARG PHP_VERSION=8.3 -RUN apt-get install -y \ - php${PHP_VERSION}-ast \ - php${PHP_VERSION}-cli \ - php${PHP_VERSION}-curl \ - php${PHP_VERSION}-dev \ - php${PHP_VERSION}-grpc \ - php${PHP_VERSION}-intl \ - php${PHP_VERSION}-mbstring \ - php${PHP_VERSION}-opcache \ - php${PHP_VERSION}-opentelemetry \ - php${PHP_VERSION}-protobuf \ - php${PHP_VERSION}-simplexml \ - php${PHP_VERSION}-sockets \ - php${PHP_VERSION}-xdebug \ - php${PHP_VERSION}-zip \ - php${PHP_VERSION}-mongodb \ - php${PHP_VERSION}-amqp \ - php${PHP_VERSION}-rdkafka \ - php${PHP_VERSION}-mysqli \ - php${PHP_VERSION}-pgsql \ - php${PHP_VERSION}-sqlite3 \ - unzip +RUN set -eux; \ + major=${PHP_VERSION%%.*}; minor=${PHP_VERSION#*.}; \ + if [ "$major" -gt 8 ] || { [ "$major" -eq 8 ] && [ "$minor" -ge 5 ]; }; then \ + OPCACHE_PKG=""; \ + else \ + OPCACHE_PKG="php${PHP_VERSION}-opcache"; \ + fi; \ + apt-get install -y \ + php${PHP_VERSION}-ast \ + php${PHP_VERSION}-cli \ + php${PHP_VERSION}-curl \ + php${PHP_VERSION}-dev \ + php${PHP_VERSION}-grpc \ + php${PHP_VERSION}-intl \ + php${PHP_VERSION}-mbstring \ + ${OPCACHE_PKG} \ + php${PHP_VERSION}-opentelemetry \ + php${PHP_VERSION}-protobuf \ + php${PHP_VERSION}-simplexml \ + php${PHP_VERSION}-sockets \ + php${PHP_VERSION}-xdebug \ + php${PHP_VERSION}-zip \ + php${PHP_VERSION}-mongodb \ + php${PHP_VERSION}-amqp \ + php${PHP_VERSION}-rdkafka \ + php${PHP_VERSION}-mysqli \ + php${PHP_VERSION}-pgsql \ + php${PHP_VERSION}-sqlite3 \ + unzip COPY --from=composer /usr/bin/composer /usr/local/bin/composer diff --git a/rector.php b/rector.php index 2b8c7ae29..38e8586ea 100644 --- a/rector.php +++ b/rector.php @@ -6,8 +6,7 @@ use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector; use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector; use Rector\Config\RectorConfig; -use Rector\Php81\Rector\ClassMethod\NewInInitializerRector; -use Rector\Php81\Rector\Property\ReadOnlyPropertyRector; +use Rector\Php82\Rector\Class_\ReadOnlyClassRector; use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector; use Rector\PHPUnit\Set\PHPUnitSetList; use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector; @@ -23,22 +22,16 @@ ]); $rectorConfig->sets([ - SetList::PHP_81, + SetList::PHP_82, SetList::CODE_QUALITY, PHPUnitSetList::PHPUNIT_100, ]); $rectorConfig->rule(AddOverrideAttributeToOverriddenMethodsRector::class); $rectorConfig->skip([ FlipTypeControlToUseExclusiveTypeRector::class, - NewInInitializerRector::class => [ - __DIR__ . '/src/SDK/Trace/Sampler/ParentBased.php', - ], - ReadOnlyPropertyRector::class => [ - __DIR__ . '/src/SDK/Metrics/Stream/SynchronousMetricStream.php', - __DIR__ . '/tests/Unit/Extension/Propagator', - ], DisallowedEmptyRuleFixerRector::class, ExplicitBoolCompareRector::class, LocallyCalledStaticMethodToNonStaticRector::class, + ReadOnlyClassRector::class, ]); }; diff --git a/src/API/composer.json b/src/API/composer.json index fc7a6017c..8b672503f 100644 --- a/src/API/composer.json +++ b/src/API/composer.json @@ -17,7 +17,7 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "open-telemetry/context": "^1.4", "psr/log": "^1.1|^2.0|^3.0", "symfony/polyfill-php82": "^1.26" diff --git a/src/Config/SDK/composer.json b/src/Config/SDK/composer.json index 87de6d155..1665e8ed7 100644 --- a/src/Config/SDK/composer.json +++ b/src/Config/SDK/composer.json @@ -17,7 +17,7 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "open-telemetry/api": "^1.8", "open-telemetry/context": "^1.4", "open-telemetry/sdk": "^1.8", diff --git a/src/Context/composer.json b/src/Context/composer.json index 73245104a..54dd24d9b 100644 --- a/src/Context/composer.json +++ b/src/Context/composer.json @@ -17,8 +17,7 @@ } ], "require": { - "php": "^8.1", - "symfony/polyfill-php82": "^1.26" + "php": "^8.2" }, "autoload": { "psr-4": { diff --git a/src/Contrib/Grpc/composer.json b/src/Contrib/Grpc/composer.json index 7b37bcd24..27f12ea70 100644 --- a/src/Contrib/Grpc/composer.json +++ b/src/Contrib/Grpc/composer.json @@ -17,7 +17,7 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "ext-grpc": "*", "grpc/grpc": "*", "open-telemetry/sdk": "^1.0" diff --git a/src/Contrib/Otlp/composer.json b/src/Contrib/Otlp/composer.json index 26518e85f..eb9103a62 100644 --- a/src/Contrib/Otlp/composer.json +++ b/src/Contrib/Otlp/composer.json @@ -17,7 +17,7 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "php-http/discovery": "^1.14", "open-telemetry/gen-otlp-protobuf": "^1.1", "open-telemetry/api": "^1.0", diff --git a/src/Contrib/Zipkin/composer.json b/src/Contrib/Zipkin/composer.json index 9580cfd75..e88fb2887 100644 --- a/src/Contrib/Zipkin/composer.json +++ b/src/Contrib/Zipkin/composer.json @@ -17,7 +17,7 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "open-telemetry/api": "^1.0", "open-telemetry/sdk": "^1.0", "php-http/async-client-implementation": "^1.0", diff --git a/src/Extension/Propagator/B3/composer.json b/src/Extension/Propagator/B3/composer.json index 185293c69..ca62acd2b 100644 --- a/src/Extension/Propagator/B3/composer.json +++ b/src/Extension/Propagator/B3/composer.json @@ -17,7 +17,7 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "open-telemetry/api": "^1.0", "open-telemetry/context": "^1.0" }, diff --git a/src/Extension/Propagator/CloudTrace/composer.json b/src/Extension/Propagator/CloudTrace/composer.json index 1be654824..cf575da24 100644 --- a/src/Extension/Propagator/CloudTrace/composer.json +++ b/src/Extension/Propagator/CloudTrace/composer.json @@ -17,7 +17,7 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "open-telemetry/api": "^1.0", "open-telemetry/context": "^1.0" }, diff --git a/src/SDK/composer.json b/src/SDK/composer.json index 7f63fb3b7..c9dc8a345 100644 --- a/src/SDK/composer.json +++ b/src/SDK/composer.json @@ -17,7 +17,7 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "ext-json": "*", "nyholm/psr7-server": "^1.1", "open-telemetry/api": "^1.7",