Skip to content

Commit 1c85d11

Browse files
committed
Changed the file name of the abstract node
1 parent 9e1a0e8 commit 1c85d11

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

src/PHPHtmlParser/Dom.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public function firstChild()
216216
/**
217217
* Simple wrapper function that returns the last child.
218218
*
219-
* @return Node
219+
* @return AbstractNode
220220
*/
221221
public function lastChild()
222222
{
@@ -228,7 +228,7 @@ public function lastChild()
228228
* Simple wrapper function that returns an element by the
229229
* id.
230230
*
231-
* @return Node
231+
* @return AbstractNode
232232
*/
233233
public function getElementById($id)
234234
{

src/PHPHtmlParser/Dom/Node.php renamed to src/PHPHtmlParser/Dom/AbstractNode.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* Dom node object.
99
*/
10-
abstract class Node {
10+
abstract class AbstractNode {
1111

1212
/**
1313
* Contains the tag name/type
@@ -124,11 +124,11 @@ public function getParent()
124124
/**
125125
* Sets the parent node.
126126
*
127-
* @param Node $parent
127+
* @param AbstractNode $parent
128128
* @chainable
129129
* @throws Exception
130130
*/
131-
public function setParent(Node $parent)
131+
public function setParent(AbstractNode $parent)
132132
{
133133
// check integrity
134134
if ($this->isDescendant($parent->id()))
@@ -190,7 +190,7 @@ public function hasChildren()
190190
* Returns the child by id.
191191
*
192192
* @param int $id
193-
* @return Node
193+
* @return AbstractNode
194194
* @throw Exception
195195
*/
196196
public function getChild($id)
@@ -207,10 +207,10 @@ public function getChild($id)
207207
* Adds a child node to this node and returns the id of the child for this
208208
* parent.
209209
*
210-
* @param Node $child
210+
* @param AbstractNode $child
211211
* @return bool
212212
*/
213-
public function addChild(Node $child)
213+
public function addChild(AbstractNode $child)
214214
{
215215
$key = null;
216216
$newKey = 0;
@@ -291,7 +291,7 @@ public function removeChild($id)
291291
* Attempts to get the next child.
292292
*
293293
* @param int $id
294-
* @return Node
294+
* @return AbstractNode
295295
* @uses $this->getChild()
296296
*/
297297
public function nextChild($id)
@@ -305,7 +305,7 @@ public function nextChild($id)
305305
* Attempts to get the previous child.
306306
*
307307
* @param int $id
308-
* @return Node
308+
* @return AbstractNode
309309
* @uses $this->getChild()
310310
*/
311311
public function previousChild($id)
@@ -367,7 +367,7 @@ public function isAncestor($id)
367367
* Attempts to get an ancestor node by the given id.
368368
*
369369
* @param int $id
370-
* @return null|Node
370+
* @return null|AbstractNode
371371
*/
372372
public function getAncestor($id)
373373
{
@@ -386,7 +386,7 @@ public function getAncestor($id)
386386
/**
387387
* Shortcut to return the first child.
388388
*
389-
* @return Node
389+
* @return AbstractNode
390390
* @uses $this->getChild()
391391
*/
392392
public function firstChild()
@@ -399,7 +399,7 @@ public function firstChild()
399399
/**
400400
* Attempts to get the last child.
401401
*
402-
* @return Node
402+
* @return AbstractNode
403403
*/
404404
public function lastChild()
405405
{
@@ -411,7 +411,7 @@ public function lastChild()
411411
/**
412412
* Attempts to get the next sibling.
413413
*
414-
* @return Node
414+
* @return AbstractNode
415415
* @throws Exception
416416
*/
417417
public function nextSibling()
@@ -427,7 +427,7 @@ public function nextSibling()
427427
/**
428428
* Attempts to get the previous sibling
429429
*
430-
* @return Node
430+
* @return AbstractNode
431431
* @throw Exception
432432
*/
433433
public function previousSibling()
@@ -488,7 +488,7 @@ public function getAttribute($key)
488488
* Function to locate a specific ancestor tag in the path to the root.
489489
*
490490
* @param string $tag
491-
* @return Node
491+
* @return AbstractNode
492492
* @throws Exception
493493
*/
494494
public function ancestorByTag($tag)

src/PHPHtmlParser/Dom/Collection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Collection implements IteratorAggregate, ArrayAccess, Countable {
2626
public function __call($method, $arguments)
2727
{
2828
$node = reset($this->collection);
29-
if ($node instanceof Node)
29+
if ($node instanceof AbstractNode)
3030
{
3131
return call_user_func_array([$node, $method], $arguments);
3232
}
@@ -42,7 +42,7 @@ public function __call($method, $arguments)
4242
public function __get($key)
4343
{
4444
$node = reset($this->collection);
45-
if ($node instanceof Node)
45+
if ($node instanceof AbstractNode)
4646
{
4747
return $node->$key;
4848
}
@@ -57,7 +57,7 @@ public function __get($key)
5757
public function __toString()
5858
{
5959
$node = reset($this->collection);
60-
if ($node instanceof Node)
60+
if ($node instanceof AbstractNode)
6161
{
6262
return (string) $node;
6363
}

src/PHPHtmlParser/Dom/HtmlNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace PHPHtmlParser\Dom;
33

4-
class HtmlNode extends Node {
4+
class HtmlNode extends AbstractNode {
55

66
/**
77
* Remembers what the innerHtml was if it was scaned previously.

src/PHPHtmlParser/Dom/MockNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* This object is not to be used for any other reason.
1010
*/
11-
class MockNode extends Node {
11+
class MockNode extends AbstractNode {
1212

1313
public function innerHtml() {}
1414

src/PHPHtmlParser/Dom/TextNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace PHPHtmlParser\Dom;
33

4-
class TextNode extends Node {
4+
class TextNode extends AbstractNode {
55

66
/**
77
* This is a text node.

0 commit comments

Comments
 (0)