1 | <?php |
||
13 | class SimpleHtmlDomNode extends \ArrayObject implements SimpleHtmlDomNodeInterface |
||
14 | { |
||
15 | /** @noinspection MagicMethodsValidityInspection */ |
||
16 | /** |
||
17 | * @param string $name |
||
18 | * |
||
19 | * @return array|null |
||
20 | */ |
||
21 | 3 | public function __get($name) |
|
39 | |||
40 | /** |
||
41 | * alias for "$this->innerHtml()" (added for compatibly-reasons with v1.x) |
||
42 | */ |
||
43 | public function outertext() |
||
47 | |||
48 | /** |
||
49 | * alias for "$this->innerHtml()" (added for compatibly-reasons with v1.x) |
||
50 | */ |
||
51 | public function innertext() |
||
55 | |||
56 | /** |
||
57 | * @param string $selector |
||
58 | * @param int $idx |
||
59 | * |
||
60 | * @return SimpleHtmlDomNode[]|SimpleHtmlDomNode|null |
||
61 | */ |
||
62 | public function __invoke($selector, $idx = null) |
||
66 | |||
67 | /** |
||
68 | * @return string |
||
69 | */ |
||
70 | 1 | public function __toString() |
|
79 | |||
80 | /** |
||
81 | * Find list of nodes with a CSS selector. |
||
82 | * |
||
83 | * @param string $selector |
||
84 | * @param int $idx |
||
85 | * |
||
86 | * @return SimpleHtmlDomNode[]|SimpleHtmlDomNode|null |
||
87 | */ |
||
88 | 11 | public function find($selector, $idx = null) |
|
114 | |||
115 | /** |
||
116 | * Get html of elements. |
||
117 | * |
||
118 | * @return array |
||
119 | */ |
||
120 | 1 | public function innerHtml() |
|
129 | |||
130 | /** |
||
131 | * Get plain text. |
||
132 | * |
||
133 | * @return array |
||
134 | */ |
||
135 | 2 | public function text() |
|
144 | } |
||
145 |
PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.
Let’s take a look at an example:
If we look at the
getEmail()
method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:On the hand, if we look at the
setEmail()
, this method _has_ side-effects. In the following case, we could not remove the method call: