From 7f7acaa5ff0767383ab21c2cdc32e8e475e26a70 Mon Sep 17 00:00:00 2001 From: Bob Strecansky Date: Tue, 15 Dec 2020 15:28:57 -0500 Subject: [PATCH] PHP 8 Compatiblity trial - adding PHP 8.0 (#231) --- .github/workflows/php.yml | 4 +++- .phan/config.php | 2 +- composer.json | 10 +++++----- contrib/Otlp/Exporter.php | 2 +- contrib/Zipkin/Exporter.php | 2 +- docker/Dockerfile | 4 ++-- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index adb378b55..39886bde7 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: ['7.3', '7.4'] + php-versions: ['7.3', '7.4', '8.0'] steps: - uses: actions/checkout@v2 @@ -44,6 +44,8 @@ jobs: run: composer install --prefer-dist --no-progress --no-suggest - name: Check Style + env: + PHP_CS_FIXER_IGNORE_ENV: 1 run: vendor/bin/php-cs-fixer fix --config=.php_cs -v --dry-run --stop-on-violation --using-cache=no - name: Run Phan diff --git a/.phan/config.php b/.phan/config.php index 9ef4e45d3..9724b4f11 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -366,7 +366,7 @@ 'vendor/php-http', 'vendor/phan/phan/src/Phan', 'vendor/phpunit/phpunit/src', - 'vendor/endclothing/prometheus_client_php/src', + 'vendor/promphp/prometheus_client_php/src', ], // A list of individual files to include in analysis diff --git a/composer.json b/composer.json index bfc90273f..81ca4149d 100644 --- a/composer.json +++ b/composer.json @@ -4,12 +4,12 @@ "type": "library", "license": "Apache-2.0", "require": { - "php": "^7.3", + "php": "^7.3 || ^8.0", "ext-json": "*", - "guzzlehttp/guzzle": "^6.5", + "guzzlehttp/guzzle": "^7.1.0", "psr/http-client": "^1.0", - "php-http/guzzle6-adapter": "^2.0", - "endclothing/prometheus_client_php": "^1.0" + "php-http/guzzle7-adapter": "^0.1.1", + "promphp/prometheus_client_php": "^2.2.1" }, "authors": [ { @@ -42,7 +42,7 @@ "phpunit/phpunit": "^9.3", "composer/xdebug-handler": "^1.3", "phan/phan": "^3.0", - "friendsofphp/php-cs-fixer": "^2.16", + "friendsofphp/php-cs-fixer": "^2.17.1", "vimeo/psalm": "^4.0", "phpstan/phpstan": "^0.12.50", "phpstan/phpstan-phpunit": "^0.12.16", diff --git a/contrib/Otlp/Exporter.php b/contrib/Otlp/Exporter.php index 2cee29d11..f874845f3 100644 --- a/contrib/Otlp/Exporter.php +++ b/contrib/Otlp/Exporter.php @@ -7,7 +7,7 @@ use GuzzleHttp\HandlerStack; use GuzzleHttp\Middleware; use GuzzleHttp\Psr7\Request; -use Http\Adapter\Guzzle6\Client; +use Http\Adapter\Guzzle7\Client; use OpenTelemetry\Sdk\Trace; use OpenTelemetry\Trace as API; use Psr\Http\Client\ClientExceptionInterface; diff --git a/contrib/Zipkin/Exporter.php b/contrib/Zipkin/Exporter.php index 4d7bf6c16..b126ca2cc 100644 --- a/contrib/Zipkin/Exporter.php +++ b/contrib/Zipkin/Exporter.php @@ -7,7 +7,7 @@ use GuzzleHttp\HandlerStack; use GuzzleHttp\Middleware; use GuzzleHttp\Psr7\Request; -use Http\Adapter\Guzzle6\Client; +use Http\Adapter\Guzzle7\Client; use InvalidArgumentException; use OpenTelemetry\Sdk\Trace; use OpenTelemetry\Trace as API; diff --git a/docker/Dockerfile b/docker/Dockerfile index 9e8f39261..eaf03f8f0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,10 +1,10 @@ -FROM php:7.3-buster +FROM php:8-buster RUN apt-get -y update && apt-get -y install git zip && \ curl -sS https://getcomposer.org/installer | php && \ mv composer.phar /usr/local/bin/composer && \ chmod +x /usr/local/bin/composer && \ -pecl install ast-1.0.4 xdebug && \ +pecl install ast-1.0.10 xdebug && \ docker-php-ext-enable ast xdebug && \ # The pcntl extension is used for speeding up `make phan` docker-php-ext-install pcntl