From 3ac5f86f83b8253bf84564dfcd4a58c92d7d6404 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 22 Dec 2020 22:08:28 +0100 Subject: [PATCH 1/4] Update PHP to 8.0 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index f2a8d9c32..7fccdcfcf 100644 --- a/composer.json +++ b/composer.json @@ -33,13 +33,13 @@ } }, "require": { - "php": "^7.2.5", + "php": "^7.2.5|8.0", "guzzlehttp/guzzle": "^7.0", "guzzlehttp/uri-template": "0.2", "justinrainbow/json-schema": "^5.2" }, "require-dev": { - "phpunit/phpunit": "^6.5", + "phpunit/phpunit": "^9.5", "psr/log": "^1.0", "php-coveralls/php-coveralls": "^2.0", "jakub-onderka/php-parallel-lint": "^1.0", From e62d955ca56cb2be00abdd6851559def2faac786 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 22 Dec 2020 22:10:59 +0100 Subject: [PATCH 2/4] Add Travis build for PHP 8.0 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 3dc03a03a..38eb1c36f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ matrix: - php: 7.2 - php: 7.3 - php: 7.4 + - php: 8.0 - php: nightly allow_failures: - php: nightly From cf93bc9d8c684588984f93048b5c51b535ecbe31 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 22 Dec 2020 22:58:03 +0100 Subject: [PATCH 3/4] Lower PHPUnit to 8.0 to keep compatibility with PHP 7.2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7fccdcfcf..0e3fa19f0 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "justinrainbow/json-schema": "^5.2" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^8.0", "psr/log": "^1.0", "php-coveralls/php-coveralls": "^2.0", "jakub-onderka/php-parallel-lint": "^1.0", From 9e367ea43a65e6bac530e2daa9b402a0b3727e3c Mon Sep 17 00:00:00 2001 From: David Date: Tue, 22 Dec 2020 23:46:07 +0100 Subject: [PATCH 4/4] Apply PHPCS --- src/Common/Transport/Middleware.php | 2 +- src/OpenStack.php | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Common/Transport/Middleware.php b/src/Common/Transport/Middleware.php index a601741fc..5f3077ca4 100644 --- a/src/Common/Transport/Middleware.php +++ b/src/Common/Transport/Middleware.php @@ -20,7 +20,7 @@ public static function httpErrors(): callable return function (callable $handler) { return function ($request, array $options) use ($handler) { return $handler($request, $options)->then( - function (ResponseInterface $response) use ($request, $handler) { + function (ResponseInterface $response) use ($request) { if ($response->getStatusCode() < 400) { return $response; } diff --git a/src/OpenStack.php b/src/OpenStack.php index 3da8700f6..822de3030 100644 --- a/src/OpenStack.php +++ b/src/OpenStack.php @@ -77,7 +77,7 @@ private function getDefaultIdentityService(array $options): Service * * @param array $options options that will be used in configuring the service */ - public function computeV2(array $options = []): \OpenStack\Compute\v2\Service + public function computeV2(array $options = []): Compute\v2\Service { $defaults = ['catalogName' => 'nova', 'catalogType' => 'compute']; @@ -89,7 +89,7 @@ public function computeV2(array $options = []): \OpenStack\Compute\v2\Service * * @param array $options options that will be used in configuring the service */ - public function networkingV2(array $options = []): \OpenStack\Networking\v2\Service + public function networkingV2(array $options = []): Networking\v2\Service { $defaults = ['catalogName' => 'neutron', 'catalogType' => 'network']; @@ -101,7 +101,7 @@ public function networkingV2(array $options = []): \OpenStack\Networking\v2\Serv * * @param array $options options that will be used in configuring the service */ - public function networkingV2ExtLayer3(array $options = []): \OpenStack\Networking\v2\Extensions\Layer3\Service + public function networkingV2ExtLayer3(array $options = []): Networking\v2\Extensions\Layer3\Service { $defaults = ['catalogName' => 'neutron', 'catalogType' => 'network']; @@ -113,7 +113,7 @@ public function networkingV2ExtLayer3(array $options = []): \OpenStack\Networkin * * @param array $options options that will be used in configuring the service */ - public function networkingV2ExtSecGroups(array $options = []): \OpenStack\Networking\v2\Extensions\SecurityGroups\Service + public function networkingV2ExtSecGroups(array $options = []): Networking\v2\Extensions\SecurityGroups\Service { $defaults = ['catalogName' => 'neutron', 'catalogType' => 'network']; @@ -125,7 +125,7 @@ public function networkingV2ExtSecGroups(array $options = []): \OpenStack\Networ * * @param array $options options that will be used in configuring the service */ - public function identityV2(array $options = []): \OpenStack\Identity\v2\Service + public function identityV2(array $options = []): Identity\v2\Service { $defaults = ['catalogName' => 'keystone', 'catalogType' => 'identity']; @@ -137,7 +137,7 @@ public function identityV2(array $options = []): \OpenStack\Identity\v2\Service * * @param array $options options that will be used in configuring the service */ - public function identityV3(array $options = []): \OpenStack\Identity\v3\Service + public function identityV3(array $options = []): Service { $defaults = ['catalogName' => 'keystone', 'catalogType' => 'identity']; @@ -149,7 +149,7 @@ public function identityV3(array $options = []): \OpenStack\Identity\v3\Service * * @param array $options options that will be used in configuring the service */ - public function objectStoreV1(array $options = []): \OpenStack\ObjectStore\v1\Service + public function objectStoreV1(array $options = []): ObjectStore\v1\Service { $defaults = ['catalogName' => 'swift', 'catalogType' => 'object-store']; @@ -161,7 +161,7 @@ public function objectStoreV1(array $options = []): \OpenStack\ObjectStore\v1\Se * * @param array $options options that will be used in configuring the service */ - public function blockStorageV2(array $options = []): \OpenStack\BlockStorage\v2\Service + public function blockStorageV2(array $options = []): BlockStorage\v2\Service { $defaults = ['catalogName' => 'cinderv2', 'catalogType' => 'volumev2']; @@ -173,7 +173,7 @@ public function blockStorageV2(array $options = []): \OpenStack\BlockStorage\v2\ * * @param array $options options that will be used in configuring the service */ - public function imagesV2(array $options = []): \OpenStack\Images\v2\Service + public function imagesV2(array $options = []): Images\v2\Service { $defaults = ['catalogName' => 'glance', 'catalogType' => 'image']; @@ -183,7 +183,7 @@ public function imagesV2(array $options = []): \OpenStack\Images\v2\Service /** * Creates a new Gnocchi Metric service v1. */ - public function metricGnocchiV1(array $options = []): \OpenStack\Metric\v1\Gnocchi\Service + public function metricGnocchiV1(array $options = []): Metric\v1\Gnocchi\Service { $defaults = ['catalogName' => 'gnocchi', 'catalogType' => 'metric'];