Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: symfony 4.3 deprecation - #32 #39

Merged
merged 1 commit into from
Aug 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ php:
- '7.1'

before_script:
- composer install --dev -v --prefer-source
- php -d memory_limit=-1 composer install --dev -v --prefer-source

script:
- bin/phpspec run -fpretty --verbose
Expand Down
25 changes: 25 additions & 0 deletions spec/DependencyInjection/ConfigurationSpec.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace spec\Welp\MailchimpBundle\DependencyInjection;

use PhpSpec\ObjectBehavior;

class ConfigurationSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType('Welp\MailchimpBundle\DependencyInjection\Configuration');
}

function it_is_symfony_configuration()
{
$this->shouldImplement('Symfony\Component\Config\Definition\ConfigurationInterface');
}

function it_gets_config_tree_builder()
{
$this
->getConfigTreeBuilder()
->shouldHaveType('Symfony\Component\Config\Definition\Builder\TreeBuilder');
}
}
9 changes: 7 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('welp_mailchimp');
$treeBuilder = new TreeBuilder('welp_mailchimp');

if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
$rootNode = $treeBuilder->root('welp_mailchimp');
}

$rootNode
->children()
Expand Down