1 | <?php |
||
13 | class SimpleHtmlDomNode extends \ArrayObject implements SimpleHtmlDomNodeInterface |
||
14 | { |
||
15 | /** |
||
16 | * @param $name |
||
17 | * |
||
18 | * @return string |
||
19 | */ |
||
20 | 2 | public function __get($name) |
|
34 | |||
35 | /** |
||
36 | * alias for "$this->innerHtml()" (added for compatibly-reasons with v1.x) |
||
37 | */ |
||
38 | public function outertext() |
||
42 | |||
43 | /** |
||
44 | * alias for "$this->innerHtml()" (added for compatibly-reasons with v1.x) |
||
45 | */ |
||
46 | public function innertext() |
||
50 | |||
51 | /** |
||
52 | * @param string $selector |
||
53 | * @param int $idx |
||
54 | * |
||
55 | * @return SimpleHtmlDom|SimpleHtmlDomNode|null |
||
56 | */ |
||
57 | public function __invoke($selector, $idx = null) |
||
61 | |||
62 | /** |
||
63 | * @return mixed |
||
64 | */ |
||
65 | public function __toString() |
||
69 | |||
70 | /** |
||
71 | * Find list of nodes with a CSS selector |
||
72 | * |
||
73 | * @param string $selector |
||
74 | * @param int $idx |
||
75 | * |
||
76 | * @return SimpleHtmlDomNode|SimpleHtmlDomNode[]|null |
||
77 | */ |
||
78 | 11 | public function find($selector, $idx = null) |
|
97 | |||
98 | /** |
||
99 | * Get html of Elements |
||
100 | * |
||
101 | * @return string |
||
102 | */ |
||
103 | 1 | public function innerHtml() |
|
112 | |||
113 | /** |
||
114 | * Get plain text |
||
115 | * |
||
116 | * @return string |
||
117 | */ |
||
118 | 2 | public function text() |
|
127 | } |
||
128 |
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: