Skip to content

Commit

Permalink
Fix deprecated on tree builder root (#70)
Browse files Browse the repository at this point in the history
* Fix deprecated on tree builder root

* Require symfony/config ^4.2

* fix(deps): drop support for symfony 3.4

Co-authored-by: Oliver THEBAULT <[email protected]>
  • Loading branch information
maximecolin and Oliboy50 authored Jul 26, 2020
1 parent 319f7fc commit e125929
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
},
"require": {
"php": "^7.1.3",
"symfony/config": "^4.4 || ^5.0",
"symfony/dependency-injection": "^4.4 || ^5.0",
"symfony/event-dispatcher-contracts": "^1.1 || ^2.1",
"symfony/http-kernel": "^4.4 || ^5.0",
"symfony/property-access": "^4.4 || ^5.0",
"m6web/statsd": "^1.3"
},
"require-dev": {
"atoum/atoum": "^2.8|^3.0",
"atoum/atoum": "^2.8 || ^3.0",
"m6web/coke": "~1.2",
"m6web/symfony2-coding-standard": "~1.2",
"symfony/config": "^4.4 || ^5.0",
"symfony/console": "^4.4 || ^5.0",
"symfony/dependency-injection": "^4.4 || ^5.0",
"symfony/event-dispatcher-contracts": "^1.1 || ^2.1",
"symfony/http-foundation": "^4.4 || ^5.0",
"symfony/http-kernel": "^4.4 || ^5.0"
"symfony/http-foundation": "^4.4 || ^5.0"
},
"autoload": {
"psr-4": {
Expand Down
10 changes: 2 additions & 8 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
// symfony/config >= 4.2.0
if (\method_exists(TreeBuilder::class, 'getRootNode')) {
$treeBuilder = new TreeBuilder('m6_statsd');
$rootNode = $treeBuilder->getRootNode();
} else {
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('m6_statsd');
}
$treeBuilder = new TreeBuilder('m6_statsd');
$rootNode = $treeBuilder->getRootNode();

$this->addServersSection($rootNode);
$this->addClientsSection($rootNode);
Expand Down

0 comments on commit e125929

Please sign in to comment.