diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7dd95b4..af7c148 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,7 +15,7 @@ jobs: name: Check code meets standards and tests pass (by localhost config) runs-on: ubuntu-latest env: - PHP_VERSION: '7.1' + PHP_VERSION: '7.2' steps: - uses: actions/checkout@v2 @@ -46,13 +46,13 @@ jobs: name: Run only tests on PHP ${{ matrix.php }} on ${{ matrix.os }} with ${{ matrix.deps-level }} ${{ matrix.symfony }} dependency level runs-on: ${{ matrix.os }} env: - COMPOSER_ALL_DEV_DEPENDENCIES_WITHOUT_PHPUNIT: phing/phing phpstan/phpstan php-parallel-lint/php-parallel-lint shopsys/coding-standards symfony/var-dumper symplify/easy-coding-standard phpstan/phpstan-phpunit + COMPOSER_ALL_DEV_DEPENDENCIES_WITHOUT_PHPUNIT: phing/phing php-parallel-lint/php-parallel-lint phpstan/phpstan phpstan/phpstan-phpunit shopsys/coding-standards symfony/var-dumper strategy: matrix: os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ] - php: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ] + php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ] deps-level: [ 'lowest', 'highest' ] - symfony: [ '^3.4.31', '^4.0.10', '^5.0', '^6.0', '^7.0' ] + symfony: [ '^4.2.0', '^5.0', '^6.0', '^7.0' ] exclude: # symfony/console fails on "YamlStandards\Command\YamlCommandTest::testCorrectRunCommandForFix -> Trying to access array offset on value of type int" and I think it's not necessary fix it, so I skip it - php: '7.4' @@ -62,10 +62,6 @@ jobs: - php: '7.3' os: 'macos-latest' # don't run check symfony versions without supported php - - php: '7.1' - symfony: '^5.0' - - php: '7.1' - symfony: '^6.0' - php: '7.2' symfony: '^6.0' - php: '7.3' diff --git a/.gitignore b/.gitignore index ef916b6..645c7d1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /composer.lock .php_cs.cache /.idea +.phpunit.result.cache diff --git a/composer.json b/composer.json index ded0cc1..803b506 100644 --- a/composer.json +++ b/composer.json @@ -26,23 +26,27 @@ } }, "require": { - "php": "^7.1 || ^8.0", - "symfony/console": "^3.4.31 || ^4.0.10 || ^5.0 || ^6.0 || ^7.0", - "symfony/config": "^3.4.31 || ^4.0.10 || ^5.0 || ^6.0 || ^7.0", - "symfony/yaml": "^3.4.31 || ^4.0.10 || ^5.0 || ^6.0 || ^7.0", - "sebastian/diff": "^1.4 || ^2.0 || ^3.0 || ^4.0 || ^5.0" + "php": "^7.2 || ^8.0", + "symfony/console": "^4.2.0 || ^5.0 || ^6.0 || ^7.0", + "symfony/config": "^4.2.0 || ^5.0 || ^6.0 || ^7.0", + "symfony/yaml": "^4.2.0 || ^5.0 || ^6.0 || ^7.0", + "sebastian/diff": "^3.0 || ^4.0 || ^5.0" }, "require-dev": { - "phing/phing": "^2.16.4", - "phpstan/phpstan": "^0.12", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpunit/phpunit": "^7.5 || ^9.0", - "shopsys/coding-standards": "^7.3", - "symfony/var-dumper": "^3.4 || ^4.3 || ^5.0 || ^6.0", - "symplify/easy-coding-standard": "^5.4.3", - "phpstan/phpstan-phpunit": "^0.12.1" + "phing/phing": "^2.17.4", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpstan/phpstan": "^0.12.100", + "phpstan/phpstan-phpunit": "^0.12.22", + "phpunit/phpunit": "^8.5.14 || ^9.0 || ^10.0", + "shopsys/coding-standards": "^9.1.3", + "symfony/var-dumper": "^5.4.29" }, "bin": [ "bin/yaml-standards" - ] + ], + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + } } diff --git a/docker/Dockerfile b/docker/Dockerfile index fcf7a77..428c63c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.1-fpm-buster as base +FROM php:7.2-fpm-buster as base ARG project_root=. diff --git a/src/Model/Config/YamlStandardConfigDefinition.php b/src/Model/Config/YamlStandardConfigDefinition.php index 0a16b77..a2ea57a 100644 --- a/src/Model/Config/YamlStandardConfigDefinition.php +++ b/src/Model/Config/YamlStandardConfigDefinition.php @@ -38,14 +38,8 @@ public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('yaml_standards_config'); - // fix for Symfony 4.2 and newer versions - if (method_exists($treeBuilder, 'getRootNode')) { - /** @var \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $rootNode */ - $rootNode = $treeBuilder->getRootNode(); - } else { - /** @var \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $rootNode */ - $rootNode = /** @scrutinizer ignore-deprecated */ $treeBuilder->root('yaml_standards_config'); - } + /** @var \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $rootNode */ + $rootNode = $treeBuilder->getRootNode(); $this->buildItemsNode($rootNode->arrayPrototype());