summaryrefslogtreecommitdiff
path: root/src/Nodes/NodeUtility.php
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2017-12-01 20:44:35 +0000
committerAndres Rey <[email protected]>2017-12-01 20:44:35 +0000
commitecebda06241ff34eac70b247c74175b162902582 (patch)
treec919efcf1b013cbd7f1221596328f93e0b54e367 /src/Nodes/NodeUtility.php
parent8a266f2cae5dce8d1fa39c40caac8400406898bb (diff)
parenta2eded4e4df7e48a6f20d9e0449c52bf8003c471 (diff)
Merge remote-tracking branch 'origin/v1.0' into v1.0
# Conflicts: # src/NodeClass/DOMNode.php # src/Readability.php
Diffstat (limited to 'src/Nodes/NodeUtility.php')
-rw-r--r--src/Nodes/NodeUtility.php15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/Nodes/NodeUtility.php b/src/Nodes/NodeUtility.php
index f35e9c5..8938a49 100644
--- a/src/Nodes/NodeUtility.php
+++ b/src/Nodes/NodeUtility.php
@@ -3,14 +3,12 @@
namespace andreskrey\Readability\Nodes;
/**
- * Class NodeUtility
- * @package andreskrey\Readability
+ * Class NodeUtility.
*/
class NodeUtility
{
-
/**
- * Collection of regexps to check the node usability
+ * Collection of regexps to check the node usability.
*
* @var array
*/
@@ -32,12 +30,11 @@ class NodeUtility
'onlyWhitespace' => '/\x{00A0}|\s+/u'
];
-
/**
- *
- * Imported from the Element class on league\html-to-markdown
+ * Imported from the Element class on league\html-to-markdown.
*
* @param $node
+ *
* @return DOMElement
*/
public static function nextElement($node)
@@ -52,13 +49,13 @@ class NodeUtility
return $next;
}
-
/**
* Changes the node tag name. Since tagName on DOMElement is a read only value, this must be done creating a new
* element with the new tag name and importing it to the main DOMDocument.
*
* @param string $value
* @param bool $importAttributes
+ *
* @return DOMNode
*/
public static function setNodeTag($node, $value, $importAttributes = false)
@@ -68,7 +65,6 @@ class NodeUtility
$children = $node->childNodes;
/** @var $children \DOMNodeList $i */
-
for ($i = 0; $i < $children->length; $i++) {
$import = $new->importNode($children->item($i), true);
$new->firstChild->appendChild($import);
@@ -118,7 +114,6 @@ class NodeUtility
}
}
-
/**
* Returns the next node. First checks for children (if the flag allows it), then for siblings, and finally
* for parents.