| 1 | <?php |
||
| 5 | class Node |
||
| 6 | { |
||
| 7 | public $node; |
||
| 8 | |||
| 9 | 39 | public function __construct(\DOMNode $node) |
|
| 13 | |||
| 14 | /** |
||
| 15 | * @return string |
||
| 16 | */ |
||
| 17 | 6 | public function toString() |
|
| 21 | |||
| 22 | /** |
||
| 23 | * @param string $name |
||
| 24 | * @param string|null $value |
||
| 25 | * @return string |
||
| 26 | * @throws \Exception |
||
| 27 | */ |
||
| 28 | 15 | public function attr($name, $value = null) |
|
| 40 | |||
| 41 | /** |
||
| 42 | * @return string |
||
| 43 | */ |
||
| 44 | 6 | public function text() |
|
| 48 | |||
| 49 | |||
| 50 | /** |
||
| 51 | * |
||
| 52 | */ |
||
| 53 | 3 | public function remove() |
|
| 57 | |||
| 58 | /** |
||
| 59 | * @param string $class |
||
| 60 | * @return bool |
||
| 61 | * @throws \Exception |
||
| 62 | */ |
||
| 63 | 3 | public function hasClass($class) |
|
| 69 | } |
||
| 70 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: