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/config deprecation #1153

Merged
merged 8 commits into from
Apr 3, 2020
6 changes: 5 additions & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ private function addDbalSection(ArrayNodeDefinition $node) : void
->end()
->children()
->scalarNode('class')->isRequired()->end()
->booleanNode('commented')->setDeprecated()->end()
->booleanNode('commented')->setDeprecated(
'doctrine/doctrine-bundle',
Copy link
Member

Choose a reason for hiding this comment

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

With symfony/config < 5.1 this change would now mean that the message displayed to the user would be doctrine/doctrine-bundle as the only argument of setDeprecated() used to be the message.

Copy link
Contributor Author

@jrushlow jrushlow Apr 1, 2020

Choose a reason for hiding this comment

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

hmm, would something along the lines of

$messageArray = $this-getMessage();
private func getMessage(): array
{
 if config < 5.1 $message = [] else $message ['doctrine/bundle', 2.0, 'this is why'];
}

....->setDeprecated(...$messageArray)->end()

do the trick?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think so.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i believe this is now taken care of. See my comment below...

'2.0',
'Type commenting features removed; the corresponding config parameter was deprecated and will be dropped in 3.0.'
)->end()
->end()
->end()
->end()
Expand Down