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

Type comment deprecation #628

Closed

Conversation

mikeSimonson
Copy link
Contributor

No description provided.

It can be replaced by comment feature of the doctrine
Type object.
@mikeSimonson mikeSimonson added this to the 1.7 milestone Feb 23, 2017
@mikeSimonson mikeSimonson self-assigned this Feb 23, 2017
@mikeSimonson
Copy link
Contributor Author

@stof Follow up of #623

ConnectionFactory.php Outdated Show resolved Hide resolved
@@ -97,7 +97,7 @@ private function addDbalSection(ArrayNodeDefinition $node)
->end()
->children()
->scalarNode('class')->isRequired()->end()
->booleanNode('commented')->defaultTrue()->end()
->booleanNode('commented')->defaultFalse()->end()
Copy link
Member

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...

Copy link
Contributor Author

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 ?

Copy link
Member

@stof stof Jul 10, 2017

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.

Copy link
Contributor

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)),
Copy link
Member

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
@Ocramius
Copy link
Member

Ocramius commented Feb 26, 2017 via email

@mikeSimonson mikeSimonson modified the milestones: 2.0.0, 1.7 Feb 27, 2017
@stof stof modified the milestones: 1.8.0, 2.0.0 Jul 10, 2017
@stof
Copy link
Member

stof commented Jul 10, 2017

@Ocramius I'm bringing back to a 1.x milestone, as I suggested a BC way to implement it above

Copy link
Member

@stof stof left a 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)

@kimhemsoe kimhemsoe modified the milestones: 1.8.0, 1.8.2 Nov 25, 2017
@kimhemsoe
Copy link
Member

@mikeSimonson Ping

@kimhemsoe kimhemsoe modified the milestones: 1.8.2, 1.9.1 Apr 18, 2018
@kimhemsoe kimhemsoe removed this from the 1.9.2 milestone Oct 30, 2018
@alcaeus
Copy link
Member

alcaeus commented Apr 5, 2019

Superseded by #947.

@alcaeus alcaeus closed this Apr 5, 2019
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.

None yet

6 participants