Skip to content

Commit

Permalink
drop support PHP 7.1 and Symfony 3.4 and lower version as Symfony 4.2 (
Browse files Browse the repository at this point in the history
  • Loading branch information
sspooky13 committed Feb 4, 2024
1 parent eb5206f commit c37282d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 31 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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'
Expand All @@ -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'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/composer.lock
.php_cs.cache
/.idea
.phpunit.result.cache
32 changes: 18 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:7.1-fpm-buster as base
FROM php:7.2-fpm-buster as base

ARG project_root=.

Expand Down
10 changes: 2 additions & 8 deletions src/Model/Config/YamlStandardConfigDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit c37282d

Please sign in to comment.