File tree 8 files changed +48
-9
lines changed
src/PHPHtmlParser/Dom/Node
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()
90
90
'method ' ,
91
91
'param ' ,
92
92
'property ' ,
93
+ 'property-read ' ,
93
94
'return ' ,
94
95
'throws ' ,
95
96
'type ' ,
@@ -100,7 +101,7 @@ return PhpCsFixer\Config::create()
100
101
'phpdoc_indent ' => true ,
101
102
'phpdoc_inline_tag ' => true ,
102
103
'phpdoc_no_access ' => true ,
103
- 'phpdoc_no_alias_tag ' => true ,
104
+ 'phpdoc_no_alias_tag ' => false ,
104
105
'phpdoc_no_package ' => true ,
105
106
'phpdoc_no_useless_inheritdoc ' => true ,
106
107
'phpdoc_order ' => true ,
Original file line number Diff line number Diff line change 17
17
/**
18
18
* Dom node object.
19
19
*
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
27
26
*/
28
27
abstract class AbstractNode
29
28
{
Original file line number Diff line number Diff line change 7
7
use ArrayIterator ;
8
8
use Countable ;
9
9
use IteratorAggregate ;
10
+ use PHPHtmlParser \Dom \Tag ;
10
11
11
12
/**
12
13
* Dom node object which will allow users to use it as
13
14
* 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
14
22
*/
15
23
abstract class ArrayNode extends AbstractNode implements IteratorAggregate, Countable
16
24
{
Original file line number Diff line number Diff line change 10
10
11
11
/**
12
12
* 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
13
20
*/
14
21
class HtmlNode extends InnerNode
15
22
{
Original file line number Diff line number Diff line change 4
4
5
5
namespace PHPHtmlParser \Dom \Node ;
6
6
7
+ use PHPHtmlParser \Dom \Tag ;
7
8
use PHPHtmlParser \Exceptions \ChildNotFoundException ;
8
9
use PHPHtmlParser \Exceptions \CircularException ;
9
10
use PHPHtmlParser \Exceptions \LogicalException ;
10
11
use stringEncode \Encode ;
11
12
12
13
/**
13
14
* 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
14
22
*/
15
23
abstract class InnerNode extends ArrayNode
16
24
{
Original file line number Diff line number Diff line change 4
4
5
5
namespace PHPHtmlParser \Dom \Node ;
6
6
7
+ use PHPHtmlParser \Dom \Tag ;
8
+
7
9
/**
8
10
* 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
9
18
*/
10
19
abstract class LeafNode extends AbstractNode
11
20
{
Original file line number Diff line number Diff line change 9
9
10
10
/**
11
11
* 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
12
19
*/
13
20
class TextNode extends LeafNode
14
21
{
Original file line number Diff line number Diff line change @@ -334,7 +334,7 @@ public function testInnerText()
334
334
335
335
$ node ->addChild ($ anode );
336
336
$ node ->addChild ($ span_node );
337
- $ this ->assertEquals ($ node ->innerText () , '123 456789 101112 ' );
337
+ $ this ->assertEquals ($ node ->innerText , '123 456789 101112 ' );
338
338
}
339
339
340
340
public function testTextLookInChildrenAndNoChildren ()
You can’t perform that action at this time.
0 commit comments