Completed
Push — master ( 308454...cfcf30 )
by Lars
02:18
created

SimpleHtmlDomNodeBlank::outertext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace voku\helper;
6
7
/**
8
 * @property-read string[] $outertext
9
 *                                    <p>Get dom node's outer html.</p>
10
 * @property-read string[] $plaintext
11
 *                                    <p>Get dom node's plain text.</p>
12
 */
13
class SimpleHtmlDomNodeBlank extends \ArrayObject implements SimpleHtmlDomNodeInterface
14
{
15
    /** @noinspection MagicMethodsValidityInspection */
16
17
    /**
18
     * @param string $name
19
     * @param mixed  $arguments
20
     *
21
     * @return null
22
     */
23
    public function __call($name, $arguments)
24
    {
25
        return null;
26
    }
27
28
    /**
29
     * @param string $name
30
     *
31
     * @return string|array
32
     */
33 4
    public function __get($name)
34
    {
35 4
        if ($name === 'plaintext' || $name === 'outertext') {
36 3
            return [];
37
        }
38
39 1
        return '';
40
    }
41
42
    /**
43
     * @param string $name
44
     * @param mixed  $value
45
     */
46 3
    public function __set($name, $value)
47
    {
48 3
        return;
49
    }
50
51
    /**
52
     * @param string $name
53
     *
54
     * @return bool
55
     */
56
    public function __isset($name)
57
    {
58
        return false;
59
    }
60
61
    /**
62
     * @param string $selector
63
     * @param int    $idx
64
     *
65
     * @return null
66
     */
67
    public function __invoke($selector, $idx = null)
68
    {
69
        return null;
70
    }
71
72
    /**
73
     * @return string
74
     */
75
    public function __toString()
76
    {
77
        return '';
78
    }
79
80
    /**
81
     * @param string $selector
82
     * @param null   $idx
83
     *
84
     * @return null
85
     */
86
    public function find(string $selector, $idx = null)
87
    {
88
        return null;
89
    }
90
91
    /**
92
     * Find one node with a CSS selector.
93
     *
94
     * @param string $selector
95
     *
96
     * @return null
97
     */
98
    public function findOne(string $selector)
99
    {
100
        return null;
101
    }
102
103
    /**
104
     * Get html of Elements
105
     *
106
     * @return string[]
107
     */
108
    public function innerHtml(): array
109
    {
110
        return [];
111
    }
112
113
    /**
114
     * alias for "$this->innerHtml()" (added for compatibly-reasons with v1.x)
115
     */
116
    public function innertext()
117
    {
118
        return [];
119
    }
120
121
    /**
122
     * alias for "$this->innerHtml()" (added for compatibly-reasons with v1.x)
123
     */
124
    public function outertext()
125
    {
126
        return [];
127
    }
128
129
    /**
130
     * Get plain text
131
     *
132
     * @return string[]
133
     */
134 2
    public function text(): array
135
    {
136 2
        return [];
137
    }
138
}
139