Skip to content
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
15 changes: 10 additions & 5 deletions Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class simple_html_dom_node
public $tag_start = 0;
private $dom = null;

function __construct($dom)
function __construct(simple_html_dom $dom)
{
$this->dom = $dom;
$dom->nodes[] = $this;
Expand Down Expand Up @@ -504,8 +504,14 @@ function makeup()
return $ret . $this->_[HDOM_INFO_ENDSPACE] . '>';
}

// find elements by css selector
//PaperG - added ability for find to lowercase the value of the selector.
/**
* find elements by css selector
* PaperG - added ability for find to lowercase the value of the selector.
* @param string $selector
* @param null $idx
* @param bool $lowercase
* @return simple_html_dom_node[]|simple_html_dom_node|null
*/
function find($selector, $idx=null, $lowercase=false)
{
$selectors = $this->parse_selector($selector);
Expand Down Expand Up @@ -977,6 +983,7 @@ function appendChild($node) {$node->parent($this); return $node;}
*/
class simple_html_dom
{
/** @var simple_html_dom_node $root */
public $root = null;
public $nodes = array();
public $callback = null;
Expand Down Expand Up @@ -1724,5 +1731,3 @@ function getElementByTagName($name) {return $this->find($name, 0);}
function getElementsByTagName($name, $idx=-1) {return $this->find($name, $idx);}
function loadFile() {$args = func_get_args();$this->load_file($args);}
}

?>