diff --git a/src/DOM.php b/src/DOM.php index 9daac5b..701081a 100644 --- a/src/DOM.php +++ b/src/DOM.php @@ -65,7 +65,7 @@ abstract class DOM implements Query, IteratorAggregate, Countable * * @param mixed $document * A document-like object. - * @param string|null $string + * @param string|null $selector * A CSS 3 Selector * @param array $options * An associative array of options. @@ -73,9 +73,9 @@ abstract class DOM implements Query, IteratorAggregate, Countable * @throws Exception * @see qp() */ - public function __construct($document = null, $string = null, $options = []) + public function __construct($document = null, $selector = null, $options = []) { - $string = is_string($string) ? trim($string) : ''; + $selector = is_string($selector) ? trim($selector) : ''; $this->options = $options + Options::get() + $this->options; $parser_flags = $options['parser_flags'] ?? self::DEFAULT_PARSER_FLAGS; @@ -163,12 +163,12 @@ public function __construct($document = null, $string = null, $options = []) } // Do a find if the second param was set. - if (strlen($string) > 0) { + if (strlen($selector) > 0) { // We don't issue a find because that creates a new DOMQuery. //$this->find($string); $query = new DOMTraverser($this->matches); - $query->find($string); + $query->find($selector); $this->setMatches($query->matches()); } } diff --git a/src/qp_functions.php b/src/qp_functions.php index fbffef0..bde265c 100644 --- a/src/qp_functions.php +++ b/src/qp_functions.php @@ -147,7 +147,7 @@ * * @param mixed $document * A document in one of the forms listed above. - * @param string|null $string + * @param string|null $selector * A CSS 3 selector. * @param array $options * An associative array of options. Currently supported options are listed above. @@ -155,9 +155,9 @@ * @return mixed|DOMQuery * Or possibly another QueryPath-like object if you overrode QueryPath_class. */ -function qp($document = null, $string = null, array $options = []) +function qp($document = null, $selector = null, array $options = []) { - return QueryPath::with($document, $string, $options); + return QueryPath::with($document, $selector, $options); } /**