Skip to content

Commit

Permalink
bug #17748 [DomCrawler] Remove the overridden getHash() method to pre…
Browse files Browse the repository at this point in the history
…vent problems when cloning the crawler (jakzal)

This PR was merged into the 2.8 branch.

Discussion
----------

[DomCrawler] Remove the overridden getHash() method to prevent problems when cloning the crawler

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #16421
| License       | MIT
| Doc PR        | -

Overriding the `SplObjectStorage::getHash()` is affected by a [PHP bug](https://bugs.php.net/bug.php?id=67582), which makes the Crawler unusable in Symfony 2.8 for anyone who relied on `SplObjectStorage` methods.

Removing the `getHash()` method means we will no longer trigger the deprecation error. Given this method is unlikely to be used directly and other `SplObjectStorage` methods will trigger the error, it is the simplest thing we can do to maintain BC.

Commits
-------

3d7f6c6 [DomCrawler] Remove the overridden getHash() method to prevent problems when cloning the crawler
  • Loading branch information
jakzal committed Feb 10, 2016
2 parents 3c382c5 + 3d7f6c6 commit b1e5149
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/Symfony/Component/DomCrawler/Crawler.php
Expand Up @@ -950,16 +950,6 @@ public function offsetGet($object)
return parent::offsetGet($object);
}

/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
public function getHash($object)
{
$this->triggerDeprecation(__METHOD__, true);

return parent::getHash($object);
}

/**
* Filters the list of nodes with an XPath expression.
*
Expand Down

0 comments on commit b1e5149

Please sign in to comment.