From 8682af03884bb8de880e076ce6e4122960e2d3ac Mon Sep 17 00:00:00 2001 From: core23 Date: Fri, 22 Nov 2019 18:28:28 +0100 Subject: [PATCH 1/2] Remove old symfony <4.2 code --- phpstan.neon.dist | 6 ------ src/DependencyInjection/Configuration.php | 8 ++------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 443c6823..9e1f946e 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -11,14 +11,8 @@ parameters: ignoreErrors: # Symfony DI - '#Cannot call method defaultValue\(\) on Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface\|null.#' - - "/Call to function method_exists.. with 'Symfony.+' and 'getRootNode' will always evaluate to false./" # PHPUnit - message: '#Property .*::\$.* has no typehint specified.#' path: tests/ - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\TreeBuilder::root\\(\\)\\.$#" - count: 1 - path: src/DependencyInjection/Configuration.php diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 8a137089..39c24eea 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -21,12 +21,8 @@ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('core23_dompdf'); - // Keep compatibility with symfony/config < 4.2 - if (!method_exists(TreeBuilder::class, 'getRootNode')) { - $rootNode = $treeBuilder->root('core23_dompdf'); - } else { - $rootNode = $treeBuilder->getRootNode(); - } + $rootNode = $treeBuilder->getRootNode(); + \assert($rootNode instanceof ArrayNodeDefinition); $rootNode From 9994f52c5b2ff9038a81b1ef3c0f82a9a9eae643 Mon Sep 17 00:00:00 2001 From: core23 Date: Wed, 11 Dec 2019 18:34:36 +0100 Subject: [PATCH 2/2] Add symfony version lock to matrix build --- .github/settings.yml | 18 ++++++++++++------ .github/workflows/continuous-integration.yml | 7 +++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/settings.yml b/.github/settings.yml index 956f2118..47694459 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -50,12 +50,18 @@ branches: contexts: - "Coding Standards (7.4)" - "Static Code Analysis (7.4)" - - "Tests (7.2, lowest)" - - "Tests (7.2, highest)" - - "Tests (7.3, lowest)" - - "Tests (7.3, highest)" - - "Tests (7.4, lowest)" - - "Tests (7.4, highest)" + - "Tests (7.2, lowest, ~4.2)" + - "Tests (7.2, lowest, ~5.0)" + - "Tests (7.2, highest, ~4.2)" + - "Tests (7.2, highest, ~5.0)" + - "Tests (7.3, lowest, ~4.2)" + - "Tests (7.3, lowest, ~5.0)" + - "Tests (7.3, highest, ~4.2)" + - "Tests (7.3, highest, ~5.0)" + - "Tests (7.4, lowest, ~4.2)" + - "Tests (7.4, lowest, ~5.0)" + - "Tests (7.4, highest, ~4.2)" + - "Tests (7.4, highest, ~5.0)" - "Code Coverage (7.4)" strict: true diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index d7b37c54..bda15854 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -114,6 +114,10 @@ jobs: - lowest - highest + symfony: + - ~4.2 + - ~5.0 + steps: - name: "Checkout" uses: actions/checkout@v1 @@ -133,6 +137,9 @@ jobs: restore-keys: | php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- + - name: "Lock symfony version" + run: composer require "symfony/symfony:${{ matrix.symfony }}" --no-update + - name: "Install lowest dependencies with composer" if: matrix.dependencies == 'lowest' run: composer update --no-interaction --no-progress --no-suggest --prefer-lowest