Skip to content

[DomCrawler] Added missing docblocks and removed redundant type in a return annotation #9025

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 13, 2013
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
13 changes: 11 additions & 2 deletions src/Symfony/Component/DomCrawler/Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ public function add($node)
*
* @param string $content A string to parse as HTML/XML
* @param null|string $type The content type of the string
*
* @return null|void
*/
public function addContent($content, $type = null)
{
Expand Down Expand Up @@ -710,6 +708,11 @@ public static function xpathLiteral($s)
return sprintf("concat(%s)", implode($parts, ', '));
}

/**
* @param integer $position
*
* @return \DOMElement|null
*/
private function getNode($position)
{
foreach ($this as $i => $node) {
Expand All @@ -723,6 +726,12 @@ private function getNode($position)
// @codeCoverageIgnoreEnd
}

/**
* @param \DOMElement $node
* @param string $siblingDir
*
* @return array
*/
private function sibling($node, $siblingDir = 'nextSibling')
Copy link
Member

Choose a reason for hiding this comment

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

you could even typehint the first argument (it is not a BC break as it is a private method)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was considering it but was afraid it's gonna be treated as a BC break.

Copy link
Member

Choose a reason for hiding this comment

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

The great benefit of private methods is that we can do whatever we want, so go for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one became protected in 2.3 btw.

Copy link
Member

Choose a reason for hiding this comment

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

ok, let's not change it then

{
$nodes = array();
Expand Down