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

Skip to content

[DomCrawler] Deprecate methods inherited from SplObjectStorage #15907

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

Merged
merged 1 commit into from
Sep 27, 2015

Conversation

stof
Copy link
Member

@stof stof commented Sep 26, 2015

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets half of #15849
License MIT
Doc PR n/a

There is no documentation change to be done for it: we don't document the fact that DomCrawler extends SplObjectStorage (this is an implementation detail which leaked because of using inheritance rather than composition).

@stof
Copy link
Member Author

stof commented Sep 26, 2015

All inherited methods are deprecated, except a few ones:

  • Iterator methods, because the iteration is not deprecated (even though I will probably use IteratorAggregate to implement it when removing the SplObjectStorage inheritance in 3.0)
  • count (we still want to implement Countable)
  • Serializable methods, which are totally broken and so I submitted Forbid serializing a Crawler #15906 to 2.3 instead

*/
public function detach($object)
{
@trigger_error('The method '.__METHOD__.' is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

We are using The __METHOD__ method in triggers. Should be changed everywhere here.

@xabbuh
Copy link
Member

xabbuh commented Sep 27, 2015

Should we now implement the desired interfaces explicitly so that we are aware of the fact that we need to ship custom implementations once we break the inheritance?

Status: Needs work

@stof
Copy link
Member Author

stof commented Sep 27, 2015

@xabbuh the only interfaces we need at Traversable and Countable. And we will notice it when rewriting the implementation, because most tests of the crawler are relying on them anyway.

@stof stof force-pushed the deprecate_object_storage branch from c082ddc to 997c650 Compare September 27, 2015 13:06
@stof
Copy link
Member Author

stof commented Sep 27, 2015

Updated.

Status: needs review

@fabpot
Copy link
Member

fabpot commented Sep 27, 2015

Thank you @stof.

@fabpot fabpot merged commit 997c650 into symfony:2.8 Sep 27, 2015
fabpot added a commit that referenced this pull request Sep 27, 2015
…tStorage (stof)

This PR was merged into the 2.8 branch.

Discussion
----------

[DomCrawler] Deprecate methods inherited from SplObjectStorage

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

There is no documentation change to be done for it: we don't document the fact that DomCrawler extends SplObjectStorage (this is an implementation detail which leaked because of using inheritance rather than composition).

Commits
-------

997c650 Deprecate methods inherited from SplObjectStorage
@stof stof deleted the deprecate_object_storage branch September 27, 2015 13:30
xabbuh added a commit to symfony/symfony-docs that referenced this pull request Oct 19, 2015
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #5796).

Discussion
----------

Fix for #5783

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.8
| Fixed tickets | #5783

I can confirm, that this is the only place where the `SplStorageObject` and its methods which were marked as deprecated in symfony/symfony#15907 are referenced.

Commits
-------

065d28c Fix for #5783
@fabpot fabpot mentioned this pull request Nov 16, 2015
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.

4 participants