From e26caa40c395ace03034617288a2bd6e40eb351a Mon Sep 17 00:00:00 2001 From: Ilya Zabolotnev Date: Mon, 12 Oct 2015 17:34:12 +0300 Subject: [PATCH 1/3] Update phpdocs --- src/DiDom/Document.php | 4 ++-- src/DiDom/Element.php | 9 ++++----- src/DiDom/Query.php | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/DiDom/Document.php b/src/DiDom/Document.php index cadedfa..c90649d 100644 --- a/src/DiDom/Document.php +++ b/src/DiDom/Document.php @@ -147,7 +147,7 @@ public function has($expression, $type = Query::TYPE_CSS) * * @param string $expression XPath expression or CSS selector * @param string $type the type of the expression - * @return array + * @return \DiDom\Element[] */ public function find($expression, $type = Query::TYPE_CSS) { @@ -166,7 +166,7 @@ public function find($expression, $type = Query::TYPE_CSS) /** * @param string $expression XPath expression - * @return array + * @return \DiDom\Element[] */ public function xpath($expression) { diff --git a/src/DiDom/Element.php b/src/DiDom/Element.php index 33f9d59..6f3573a 100644 --- a/src/DiDom/Element.php +++ b/src/DiDom/Element.php @@ -2,7 +2,6 @@ namespace DiDom; -use DomDocument; use DOMElement; use InvalidArgumentException; @@ -68,7 +67,7 @@ public function toDocument() * * @param string $expression XPath expression or CSS selector * @param string $type the type of the expression - * @return array instance of Element or null + * @return \DiDom\Element[] array of Elements */ public function find($expression, $type = Query::TYPE_CSS) { @@ -113,7 +112,7 @@ public function hasAttribute($name) * * @param string $name * @param string $value - * @return void + * @return \DiDom\Element */ public function setAttribute($name, $value) { @@ -228,7 +227,7 @@ public function __unset($name) * * @param string $name * @param mixed $value - * @return void + * @return \DiDom\Element */ public function __set($name, $value) { @@ -265,7 +264,7 @@ public function __toString() /** * @param string $expression * @param string $type - * @return mixed + * @return \DiDom\Element[] */ public function __invoke($expression, $type = Query::TYPE_CSS) { diff --git a/src/DiDom/Query.php b/src/DiDom/Query.php index 6ceb7c6..7593e3a 100644 --- a/src/DiDom/Query.php +++ b/src/DiDom/Query.php @@ -52,7 +52,7 @@ public static function compile($expression, $type = self::TYPE_CSS) /** * @param string $selector - * @param bool $prefix + * @param string $prefix * @return string */ public static function cssToXpath($selector, $prefix = '//') From e816eee6877f5e605161df71d3ac2fd240658ede Mon Sep 17 00:00:00 2001 From: Ilya Zabolotnev Date: Mon, 12 Oct 2015 17:34:12 +0300 Subject: [PATCH 2/3] Return usage of DomDocument --- src/DiDom/Document.php | 4 ++-- src/DiDom/Element.php | 8 ++++---- src/DiDom/Query.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/DiDom/Document.php b/src/DiDom/Document.php index cadedfa..c90649d 100644 --- a/src/DiDom/Document.php +++ b/src/DiDom/Document.php @@ -147,7 +147,7 @@ public function has($expression, $type = Query::TYPE_CSS) * * @param string $expression XPath expression or CSS selector * @param string $type the type of the expression - * @return array + * @return \DiDom\Element[] */ public function find($expression, $type = Query::TYPE_CSS) { @@ -166,7 +166,7 @@ public function find($expression, $type = Query::TYPE_CSS) /** * @param string $expression XPath expression - * @return array + * @return \DiDom\Element[] */ public function xpath($expression) { diff --git a/src/DiDom/Element.php b/src/DiDom/Element.php index 33f9d59..a0fea56 100644 --- a/src/DiDom/Element.php +++ b/src/DiDom/Element.php @@ -68,7 +68,7 @@ public function toDocument() * * @param string $expression XPath expression or CSS selector * @param string $type the type of the expression - * @return array instance of Element or null + * @return \DiDom\Element[] array of Elements */ public function find($expression, $type = Query::TYPE_CSS) { @@ -113,7 +113,7 @@ public function hasAttribute($name) * * @param string $name * @param string $value - * @return void + * @return \DiDom\Element */ public function setAttribute($name, $value) { @@ -228,7 +228,7 @@ public function __unset($name) * * @param string $name * @param mixed $value - * @return void + * @return \DiDom\Element */ public function __set($name, $value) { @@ -265,7 +265,7 @@ public function __toString() /** * @param string $expression * @param string $type - * @return mixed + * @return \DiDom\Element[] */ public function __invoke($expression, $type = Query::TYPE_CSS) { diff --git a/src/DiDom/Query.php b/src/DiDom/Query.php index 6ceb7c6..7593e3a 100644 --- a/src/DiDom/Query.php +++ b/src/DiDom/Query.php @@ -52,7 +52,7 @@ public static function compile($expression, $type = self::TYPE_CSS) /** * @param string $selector - * @param bool $prefix + * @param string $prefix * @return string */ public static function cssToXpath($selector, $prefix = '//') From 5d1342dd7dae5b8049c2f483266d0959b2f15b1f Mon Sep 17 00:00:00 2001 From: Ilya Zabolotnev Date: Mon, 12 Oct 2015 17:53:54 +0300 Subject: [PATCH 3/3] Correct the mistake in usage --- src/DiDom/Element.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DiDom/Element.php b/src/DiDom/Element.php index a0fea56..e269151 100644 --- a/src/DiDom/Element.php +++ b/src/DiDom/Element.php @@ -2,7 +2,7 @@ namespace DiDom; -use DomDocument; +use DOMDocument; use DOMElement; use InvalidArgumentException;