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 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