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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 133 additions & 3 deletions src/Symfony/Component/DomCrawler/Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function __construct($node = null, $currentUri = null, $baseHref = null)
*/
public function clear()
{
$this->removeAll($this);
parent::removeAll($this);
}

/**
Expand Down Expand Up @@ -319,9 +319,9 @@ public function addNodes(array $nodes)
public function addNode(\DOMNode $node)
{
if ($node instanceof \DOMDocument) {
$this->attach($node->documentElement);
parent::attach($node->documentElement);
} else {
$this->attach($node);
parent::attach($node);
}
}

Expand Down Expand Up @@ -876,6 +876,136 @@ public static function xpathLiteral($s)
return sprintf('concat(%s)', implode($parts, ', '));
}

/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
public function attach($object, $data = null)
{
@trigger_error('The '.__METHOD__.' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

parent::attach($object, $data);
}

/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
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);

parent::detach($object);
}

/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
public function contains($object)
{
@trigger_error('The '.__METHOD__.' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

return parent::contains($object);
}

/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
public function addAll($storage)
{
@trigger_error('The '.__METHOD__.' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

parent::addAll($storage);
}

/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
public function removeAll($storage)
{
@trigger_error('The '.__METHOD__.' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

parent::removeAll($storage);
}

/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
public function removeAllExcept($storage)
{
@trigger_error('The '.__METHOD__.' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

parent::removeAllExcept($storage);
}

/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
public function getInfo()
{
@trigger_error('The '.__METHOD__.' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

return parent::getInfo();
}

/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
public function setInfo($data)
{
@trigger_error('The '.__METHOD__.' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

parent::setInfo($data);
}

/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
public function offsetExists($object)
{
@trigger_error('The '.__METHOD__.' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

return parent::offsetExists($object);
}

/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
public function offsetSet($object, $data = null)
{
@trigger_error('The '.__METHOD__.' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

parent::offsetSet($object, $data);
}

/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
public function offsetUnset($object)
{
@trigger_error('The '.__METHOD__.' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

parent::offsetUnset($object);
}

/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
public function offsetGet($object)
{
@trigger_error('The '.__METHOD__.' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

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)
{
// Cannot trigger a deprecation warning here because SplObjectStorage calls this method when attaching an object.

return parent::getHash($object);
}

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