Skip to content

Commit eccdf53

Browse files
committed
Merge pull request #29 from WanderingZombie/patch-1
Add type hinting and DocBlock comments
2 parents ec637de + bc2aa6f commit eccdf53

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class simple_html_dom_node
131131
public $tag_start = 0;
132132
private $dom = null;
133133

134-
function __construct($dom)
134+
function __construct(simple_html_dom $dom)
135135
{
136136
$this->dom = $dom;
137137
$dom->nodes[] = $this;
@@ -504,8 +504,14 @@ function makeup()
504504
return $ret . $this->_[HDOM_INFO_ENDSPACE] . '>';
505505
}
506506

507-
// find elements by css selector
508-
//PaperG - added ability for find to lowercase the value of the selector.
507+
/**
508+
* find elements by css selector
509+
* PaperG - added ability for find to lowercase the value of the selector.
510+
* @param string $selector
511+
* @param null $idx
512+
* @param bool $lowercase
513+
* @return simple_html_dom_node[]|simple_html_dom_node|null
514+
*/
509515
function find($selector, $idx=null, $lowercase=false)
510516
{
511517
$selectors = $this->parse_selector($selector);
@@ -977,6 +983,7 @@ function appendChild($node) {$node->parent($this); return $node;}
977983
*/
978984
class simple_html_dom
979985
{
986+
/** @var simple_html_dom_node $root */
980987
public $root = null;
981988
public $nodes = array();
982989
public $callback = null;
@@ -1724,5 +1731,3 @@ function getElementByTagName($name) {return $this->find($name, 0);}
17241731
function getElementsByTagName($name, $idx=-1) {return $this->find($name, $idx);}
17251732
function loadFile() {$args = func_get_args();$this->load_file($args);}
17261733
}
1727-
1728-
?>

0 commit comments

Comments
 (0)