-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
Type comment deprecation #628
Type comment deprecation #628
Conversation
It can be replaced by comment feature of the doctrine Type object.
@@ -97,7 +97,7 @@ private function addDbalSection(ArrayNodeDefinition $node) | |||
->end() | |||
->children() | |||
->scalarNode('class')->isRequired()->end() | |||
->booleanNode('commented')->defaultTrue()->end() | |||
->booleanNode('commented')->defaultFalse()->end() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a BC break...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really a BC break if people can still use the option.
Or should I wait for v2 for this change and v3 to remove the option entirely ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest a BC way:
- trigger a deprecation whenever the field is configured explicitly (to allow removal), by using
beforeNormalization
- if the field is configured as commented (either explicitly or due to the default), the DI extension should check whether the type class overwrites the
requiresSQLCommentHint
method:- If no, it should trigger a deprecation saying that types should be marked as commented in the type itself.
- If yes, it should remove this type from the list of commented types passed to the bundle boot method (actually marking it as not commented in the parameter). Types will still be registered as commented in DBAL due to the type class itself. But it will not trigger early registration anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the first part, if it helps, I think this is an example: https://github.com/symfony/symfony/blob/2e47edc4a52c3b61664e512f849c3df5f5c20593/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php#L714-L721
It's checking to see if strict_email
is explicitly configured, and it triggers a deprecation warning if it is.
For the second part... I'm not as sure :)
@@ -531,7 +531,7 @@ public function testSetTypes() | |||
$container = $this->loadContainer('dbal_types'); | |||
|
|||
$this->assertEquals( | |||
array('test' => array('class' => TestType::class, 'commented' => true)), | |||
array('test' => array('class' => TestType::class, 'commented' => false)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a BC Break
Changing it to false before removing it entirely
81f1c57
to
0217afa
Compare
It is a bc break if the defaults change and they didn't override them.
…On 24 Feb 2017 10:28, "mikeSimonson" ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In DependencyInjection/Configuration.php
<#628 (comment)>
:
> @@ -97,7 +97,7 @@ private function addDbalSection(ArrayNodeDefinition $node)
->end()
->children()
->scalarNode('class')->isRequired()->end()
- ->booleanNode('commented')->defaultTrue()->end()
+ ->booleanNode('commented')->defaultFalse()->end()
It's not really a BC break if people can still use the option.
Or should I wait for v2 for this change and v3 to remove the option
entirely ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#628 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJakGA1zNb6OhVOXTwAkbfa_fuNWdDGks5rfqLRgaJpZM4MJ9um>
.
|
@Ocramius I'm bringing back to a 1.x milestone, as I suggested a BC way to implement it above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikeSimonson please rework the PR to be BC, based on my comment in #628 (comment)
@mikeSimonson Ping |
Superseded by #947. |
No description provided.