Skip to content

Commit

Permalink
removed dependency to "symfony/http-kernel" [#70]
Browse files Browse the repository at this point in the history
  • Loading branch information
sspooky13 committed Feb 26, 2023
1 parent f27a27a commit 4a1dd6f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
tools: composer:v2

- name: Require Symfony at version ${{ matrix.symfony }}
run: composer require --no-update "symfony/console:${{ matrix.symfony }}" "symfony/config:${{ matrix.symfony }}" "symfony/http-kernel:${{ matrix.symfony }}" "symfony/yaml:${{ matrix.symfony }}"
run: composer require --no-update "symfony/console:${{ matrix.symfony }}" "symfony/config:${{ matrix.symfony }}" "symfony/yaml:${{ matrix.symfony }}"

- name: Add caret to composer.json for symfony libraries for windows build
if: ${{ matrix.os == 'windows-latest' }}
Expand All @@ -96,7 +96,6 @@ jobs:
$symfonyVersionWithoutCaret = "${{ matrix.symfony }}".substring(1)
(Get-Content composer.json) | ForEach-Object { $_.replace('"symfony/console": "' + $symfonyVersionWithoutCaret + '"', '"symfony/console": "${{ matrix.symfony }}"') } | Set-Content composer.json
(Get-Content composer.json) | ForEach-Object { $_.replace('"symfony/config": "' + $symfonyVersionWithoutCaret + '"', '"symfony/config": "${{ matrix.symfony }}"') } | Set-Content composer.json
(Get-Content composer.json) | ForEach-Object { $_.replace('"symfony/http-kernel": "' + $symfonyVersionWithoutCaret + '"', '"symfony/http-kernel": "${{ matrix.symfony }}"') } | Set-Content composer.json
(Get-Content composer.json) | ForEach-Object { $_.replace('"symfony/yaml": "' + $symfonyVersionWithoutCaret + '"', '"symfony/yaml": "${{ matrix.symfony }}"') } | Set-Content composer.json
- name: Set composer cache directory
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
### Changed
- removed status code from result class, now it's no longer necessary

### Removed
- [#71] Composer: removed dependency to "symfony/http-kernel"

### Fixed
- [#46] CI: add support for PHP 8.1 and Symfony 5 and 6
- [#73] Command: show information about file is not readable
Expand Down Expand Up @@ -235,6 +238,7 @@ patchesJson6902:
[@DavidOstrozlik]: https://github.com/DavidOstrozlik
[@PetrHeinz]: https://github.com/PetrHeinz

[#71]: https://github.com/sspooky13/yaml-standards/issues/71
[#73]: https://github.com/sspooky13/yaml-standards/issues/73
[#70]: https://github.com/sspooky13/yaml-standards/issues/70
[#55]: https://github.com/sspooky13/yaml-standards/issues/55
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"php": "^7.1 || ^8.0",
"symfony/console": "^3.4.31 || ^4.0.10 || ^5.0 || ^6.0",
"symfony/config": "^3.4.31 || ^4.0.10 || ^5.0 || ^6.0",
"symfony/http-kernel": "^3.4.31 || ^4.0.10 || ^5.0 || ^6.0",
"symfony/yaml": "^3.4.31 || ^4.0.10 || ^5.0 || ^6.0",
"sebastian/diff": "^1.4 || ^2.0 || ^3.0 || ^4.0"
},
Expand Down
7 changes: 3 additions & 4 deletions src/Model/Config/YamlStandardConfigDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\HttpKernel\Kernel;

class YamlStandardConfigDefinition implements ConfigurationInterface
{
Expand Down Expand Up @@ -37,13 +36,13 @@ class YamlStandardConfigDefinition implements ConfigurationInterface
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('yaml_standards_config');

// fix for Symfony 4.2 and newer versions
if (Kernel::VERSION_ID >= 40200) {
$treeBuilder = new TreeBuilder('yaml_standards_config');
if (method_exists($treeBuilder, 'getRootNode')) {
/** @var \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $rootNode */
$rootNode = $treeBuilder->getRootNode();
} else {
$treeBuilder = new TreeBuilder();
/** @var \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $rootNode */
$rootNode = /** @scrutinizer ignore-deprecated */ $treeBuilder->root('yaml_standards_config');
}
Expand Down

0 comments on commit 4a1dd6f

Please sign in to comment.