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

Fixed TreeBuilder::root() symfony 4.3 deprecation #21

Merged
merged 2 commits into from
Dec 17, 2019

Conversation

Doqnach
Copy link
Contributor

@Doqnach Doqnach commented Nov 15, 2019

The "Symfony\Component\Config\Definition\Builder\TreeBuilder::root()" method called for the "qp_woohoolabs_yin" configuration is deprecated since Symfony 4.3, pass the root name to the constructor instead

The "Symfony\Component\Config\Definition\Builder\TreeBuilder::root()" method called for the "qp_woohoolabs_yin" configuration is deprecated since Symfony 4.3, pass the root name to the constructor instead
@Doqnach Doqnach changed the title Fixed TreeBuilder::root() symfony 4.2 deprecation Fixed TreeBuilder::root() symfony 4.3 deprecation Nov 15, 2019
@qpautrat
Copy link
Owner

Hello @Doqnach 👋 ,
Sorry to be so late.
Thank you for your PR.

Since sensio/framework-extra-bundle in ^5.4 accepts symfony/config ^3.4 it means your change implies we break the ^3.4 API because getRootNode function appears only from 4.2.

So we need to bump the major version and specify in composer.json the minimum version required for symfony/config.

What do you think ?

@Doqnach
Copy link
Contributor Author

Doqnach commented Dec 17, 2019

For example:

$treeBuilder = new TreeBuilder('some-root');

if (\method_exists($treeBuilder, 'getRootNode')) {
    $rootNode = $treeBuilder->getRootNode();
} else {
    // BC layer for symfony/config 4.1 and older
    $rootNode = $treeBuilder->root();
}

and then fix this behaviour with next major version, dropping support for older symfony/config.

@qpautrat
Copy link
Owner

Perfect, fine by me :)

@Doqnach
Copy link
Contributor Author

Doqnach commented Dec 17, 2019

I will try to update the PR soon [tm]

@Doqnach
Copy link
Contributor Author

Doqnach commented Dec 17, 2019

Updated the PR with the above suggested change.

Copy link
Owner

@qpautrat qpautrat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much appreciated thank you !

@qpautrat qpautrat merged commit 5e6b8b1 into qpautrat:master Dec 17, 2019
@Doqnach Doqnach deleted the patch-1 branch December 17, 2019 22:48
qpautrat added a commit that referenced this pull request Dec 23, 2019
We are taking advantage of bumping to a major version to remove deprecation support.
From version 5.5 of sensio/framework-extra-bundle the Symfony Config component has a minimal version of 4.3.
Which means `getRootNode()` function is available.

Related to #21.
qpautrat added a commit that referenced this pull request Dec 23, 2019
We are taking advantage of bumping to a major version to remove deprecation support.
From version 5.5 of sensio/framework-extra-bundle the Symfony Config component has a minimal version of 4.3.
Which means `getRootNode()` function is available.

Related to #21.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants