Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3 from zendex/feature/support-symfony-5.x
Browse files Browse the repository at this point in the history
Support symfony 5.x
  • Loading branch information
Pavel Batanov authored Jun 27, 2022
2 parents ea05cf2 + aa42859 commit 50dec4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"description": "Symfony bundle for lamoda/tactician-rate-limit library",
"type": "symfony-bundle",
"require": {
"symfony/dependency-injection": "^3.4 || ^4.0",
"symfony/http-kernel": "^3.4 || ^4.0",
"symfony/config": "^3.4 || ^4.0",
"symfony/dependency-injection": "^3.4 || ^4.0 || ^5.0",
"symfony/http-kernel": "^3.4 || ^4.0 || ^5.0",
"symfony/config": "^3.4 || ^4.0 || ^5.0",
"lamoda/tactician-rate-limit": "^0.1.0",
"symfony/yaml": "^3.4 || ^4.0"
"symfony/yaml": "^3.4 || ^4.0 || ^5.0"
},
"require-dev": {
"phpunit/phpunit": "^7.2",
Expand Down
7 changes: 5 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ final class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder(): TreeBuilder
{
$builder = new TreeBuilder();
$builder = new TreeBuilder('lamoda_tactician_rate_limit');

$root = $builder->root('lamoda_tactician_rate_limit');
// Keep compatibility with symfony/config < 4.2
$root = method_exists(TreeBuilder::class, 'getRootNode')
? $builder->getRootNode()
: $builder->root('lamoda_tactician_rate_limit');

$root
->children()
Expand Down

0 comments on commit 50dec4c

Please sign in to comment.