From 158e9ae36947b55385faedad129f1a2634b62390 Mon Sep 17 00:00:00 2001 From: ARCANEDEV Date: Tue, 1 Dec 2020 14:00:36 +0100 Subject: [PATCH] Adding PHP 8.0 support --- .github/workflows/run-tests.yml | 5 +++-- .scrutinizer.yml | 2 +- composer.json | 13 +++++++------ src/Database/DbDumperManager.php | 12 +++++------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index fbf91bd..6ec8f3b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: true matrix: - php: [7.3, 7.4] + php: [7.3, 7.4, 8.0] dependency-version: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }} @@ -35,9 +35,10 @@ jobs: php-version: ${{ matrix.php }} extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv coverage: none + tools: composer:v2 - name: Install dependencies - run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest + run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction - name: Execute tests run: | diff --git a/.scrutinizer.yml b/.scrutinizer.yml index f37ce73..5192edd 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -21,7 +21,7 @@ checks: tools: external_code_coverage: timeout: 600 - runs: 4 + runs: 6 php_code_sniffer: enabled: true config: diff --git a/composer.json b/composer.json index e79706c..b62592a 100644 --- a/composer.json +++ b/composer.json @@ -14,18 +14,19 @@ "type": "library", "license": "MIT", "require": { - "php": "^7.3", + "php": "^7.3|^8.0", "ext-json": "*", "ext-zip": "*", "arcanedev/support": "^8.0", - "league/flysystem": "^1.0.49" + "league/flysystem": "^1.1" }, "require-dev": { - "laravel/slack-notification-channel": "^2.2", + "aws/aws-sdk-php": "^3.155", + "laravel/slack-notification-channel": "^2.3", "league/flysystem-aws-s3-v3": "^1.0.1", - "mockery/mockery": "^1.3.1", - "orchestra/testbench": "^6.0", - "phpunit/phpunit": "^9.3" + "mockery/mockery": "^1.4.2", + "orchestra/testbench": "^6.4", + "phpunit/phpunit": "^9.3.3" }, "autoload": { "psr-4": { diff --git a/src/Database/DbDumperManager.php b/src/Database/DbDumperManager.php index 7790dd0..7a932a9 100644 --- a/src/Database/DbDumperManager.php +++ b/src/Database/DbDumperManager.php @@ -226,14 +226,12 @@ protected function createDumper(string $class, array $config): AbstractDumper */ protected function parseConfig(string $connection): array { - try { - $config = (new ConfigurationUrlParser)->parseConfiguration( - $this->app['config']->get("database.connections.{$connection}") - ); - } - catch (Exception $e) { + $config = $this->app['config']->get("database.connections.{$connection}"); + + if (is_null($config)) throw CannotCreateDbDumper::unsupportedDriver($connection, static::SUPPORTED_DRIVERS); - } + + $config = (new ConfigurationUrlParser)->parseConfiguration($config); if (isset($config['read'])) { $config = Arr::except(