Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DoctrineBridge] deprecate MergeDoctrineCollectionListener::onBind() #18069

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

Conversation

HeahDude
Copy link
Contributor

@HeahDude HeahDude commented Mar 9, 2016

Q A
Branch master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR -

@dosten
Copy link
Contributor

dosten commented Mar 9, 2016

But this is a BC break, isn't it? The listener will not execute the onBind method anymore if someone extends the listener, ex:

<?php

class MyMergeDoctrineCollectionListener extends MergeDoctrineCollectionListener
{
    public function onBind()
    {
        // my own implementation
    }
}

@HeahDude
Copy link
Contributor Author

HeahDude commented Mar 9, 2016

@dosten Indeed. Have to keep the old method in the getSubscribedEvents() call though.

@HeahDude HeahDude force-pushed the deprecation-merge_doctrine_collection_listener-on_bind branch 2 times, most recently from 28dbfe4 to 2819bfd Compare March 10, 2016 12:45
@HeahDude
Copy link
Contributor Author

Ok now 37cdb80 fixes the BC break and adds some tests.

@HeahDude HeahDude force-pushed the deprecation-merge_doctrine_collection_listener-on_bind branch from 2819bfd to 37cdb80 Compare March 10, 2016 12:50
@HeahDude HeahDude force-pushed the deprecation-merge_doctrine_collection_listener-on_bind branch from 37cdb80 to 6eb3873 Compare April 9, 2016 13:11
@HeahDude
Copy link
Contributor Author

HeahDude commented Apr 9, 2016

What's the status of this one ?

{
// If onBind() is overridden then logic has been executed
if ($this->bc) {
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if that is sufficient. Someone who overrode the onBind() method will likely also have added a call to parent::onBind().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@HeahDude HeahDude force-pushed the deprecation-merge_doctrine_collection_listener-on_bind branch from 6eb3873 to 2e4fdfe Compare April 11, 2016 13:03
*/
public function onBind()
{
if (self::class === __CLASS__) {
Copy link
Member

Choose a reason for hiding this comment

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

this will always be true, as self::class does not use late static binding

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 could use get_class($this) then.

@HeahDude HeahDude force-pushed the deprecation-merge_doctrine_collection_listener-on_bind branch from 2e4fdfe to 08a7a09 Compare April 12, 2016 14:38
@HeahDude
Copy link
Contributor Author

@stof Fixed, thanks.

@HeahDude
Copy link
Contributor Author

ping :)

* added "{{ value }}" message placeholder to UniqueEntityValidator
* added "{{ value }}" message placeholder to UniqueEntityValidator
* deprecated `MergeDoctrineCollectionListener::onBind` in favor of
`MergeDoctrineListener::onSubmit`
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it be MergeDoctrineCollectionListener::onSubmit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch!

@fabpot
Copy link
Member

fabpot commented Apr 28, 2016

Apart from the typo, 👍

@HeahDude HeahDude force-pushed the deprecation-merge_doctrine_collection_listener-on_bind branch from 08a7a09 to ad08b95 Compare April 28, 2016 10:28
@HeahDude
Copy link
Contributor Author

Fixed! Thanks.

@fabpot
Copy link
Member

fabpot commented Apr 28, 2016

Thank you @HeahDude.

@fabpot fabpot merged commit ad08b95 into symfony:master Apr 28, 2016
fabpot added a commit that referenced this pull request Apr 28, 2016
…tener::onBind()` (HeahDude)

This PR was merged into the 3.1-dev branch.

Discussion
----------

[DoctrineBridge] deprecate `MergeDoctrineCollectionListener::onBind()`

| Q             | A
| ------------- | ---
| Branch        | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | -

Commits
-------

ad08b95 [DoctrineBridge] deprecated `MergeDoctrineCollectionListener::onBind()`
@HeahDude HeahDude deleted the deprecation-merge_doctrine_collection_listener-on_bind branch April 28, 2016 16:57
HeahDude added a commit to HeahDude/symfony that referenced this pull request Apr 29, 2016
HeahDude added a commit to HeahDude/symfony that referenced this pull request Apr 30, 2016
HeahDude added a commit to HeahDude/symfony that referenced this pull request May 3, 2016
HeahDude added a commit to HeahDude/symfony that referenced this pull request May 3, 2016
fabpot added a commit that referenced this pull request May 11, 2016
This PR was merged into the 3.1-dev branch.

Discussion
----------

[DoctrineBridge] Fixed bc layer after #18069

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | BC break
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Commits
-------

8a6cf9d [DoctrineBridge] fixed bc layer from #18069
@fabpot fabpot mentioned this pull request May 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants