File tree Expand file tree Collapse file tree 8 files changed +48
-9
lines changed
src/PHPHtmlParser/Dom/Node Expand file tree Collapse file tree 8 files changed +48
-9
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ return PhpCsFixer\Config::create()
9090 'method ' ,
9191 'param ' ,
9292 'property ' ,
93+ 'property-read ' ,
9394 'return ' ,
9495 'throws ' ,
9596 'type ' ,
@@ -100,7 +101,7 @@ return PhpCsFixer\Config::create()
100101 'phpdoc_indent ' => true ,
101102 'phpdoc_inline_tag ' => true ,
102103 'phpdoc_no_access ' => true ,
103- 'phpdoc_no_alias_tag ' => true ,
104+ 'phpdoc_no_alias_tag ' => false ,
104105 'phpdoc_no_package ' => true ,
105106 'phpdoc_no_useless_inheritdoc ' => true ,
106107 'phpdoc_order ' => true ,
Original file line number Diff line number Diff line change 1717/**
1818 * Dom node object.
1919 *
20- * @property string $outerhtml
21- * @property string $innerhtml
22- * @property string $text
23- * @property int $prev
24- * @property int $next
25- * @property Tag $tag
26- * @property InnerNode $parent
20+ * @property-read string $outerhtml
21+ * @property-read string $innerhtml
22+ * @property-read string $innerText
23+ * @property-read string $text
24+ * @property-read Tag $tag
25+ * @property-read InnerNode $parent
2726 */
2827abstract class AbstractNode
2928{
Original file line number Diff line number Diff line change 77use ArrayIterator ;
88use Countable ;
99use IteratorAggregate ;
10+ use PHPHtmlParser \Dom \Tag ;
1011
1112/**
1213 * Dom node object which will allow users to use it as
1314 * an array.
15+ *
16+ * @property-read string $outerhtml
17+ * @property-read string $innerhtml
18+ * @property-read string $innerText
19+ * @property-read string $text
20+ * @property-read Tag $tag
21+ * @property-read InnerNode $parent
1422 */
1523abstract class ArrayNode extends AbstractNode implements IteratorAggregate, Countable
1624{
Original file line number Diff line number Diff line change 1010
1111/**
1212 * Class HtmlNode.
13+ *
14+ * @property-read string $outerhtml
15+ * @property-read string $innerhtml
16+ * @property-read string $innerText
17+ * @property-read string $text
18+ * @property-read Tag $tag
19+ * @property-read InnerNode $parent
1320 */
1421class HtmlNode extends InnerNode
1522{
Original file line number Diff line number Diff line change 44
55namespace PHPHtmlParser \Dom \Node ;
66
7+ use PHPHtmlParser \Dom \Tag ;
78use PHPHtmlParser \Exceptions \ChildNotFoundException ;
89use PHPHtmlParser \Exceptions \CircularException ;
910use PHPHtmlParser \Exceptions \LogicalException ;
1011use stringEncode \Encode ;
1112
1213/**
1314 * Inner node of the html tree, might have children.
15+ *
16+ * @property-read string $outerhtml
17+ * @property-read string $innerhtml
18+ * @property-read string $innerText
19+ * @property-read string $text
20+ * @property-read Tag $tag
21+ * @property-read InnerNode $parent
1422 */
1523abstract class InnerNode extends ArrayNode
1624{
Original file line number Diff line number Diff line change 44
55namespace PHPHtmlParser \Dom \Node ;
66
7+ use PHPHtmlParser \Dom \Tag ;
8+
79/**
810 * Class LeafNode.
11+ *
12+ * @property-read string $outerhtml
13+ * @property-read string $innerhtml
14+ * @property-read string $innerText
15+ * @property-read string $text
16+ * @property-read Tag $tag
17+ * @property-read InnerNode $parent
918 */
1019abstract class LeafNode extends AbstractNode
1120{
Original file line number Diff line number Diff line change 99
1010/**
1111 * Class TextNode.
12+ *
13+ * @property-read string $outerhtml
14+ * @property-read string $innerhtml
15+ * @property-read string $innerText
16+ * @property-read string $text
17+ * @property-read Tag $tag
18+ * @property-read InnerNode $parent
1219 */
1320class TextNode extends LeafNode
1421{
Original file line number Diff line number Diff line change @@ -334,7 +334,7 @@ public function testInnerText()
334334
335335 $ node ->addChild ($ anode );
336336 $ node ->addChild ($ span_node );
337- $ this ->assertEquals ($ node ->innerText () , '123 456789 101112 ' );
337+ $ this ->assertEquals ($ node ->innerText , '123 456789 101112 ' );
338338 }
339339
340340 public function testTextLookInChildrenAndNoChildren ()
You can’t perform that action at this time.
0 commit comments