Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
19 | public function attr($name, $value = null) |
||
20 | { |
||
21 | if (!($this->node instanceof \DOMElement)) { |
||
22 | throw new \Exception('dom node is not of type element'); |
||
23 | } |
||
24 | |||
25 | if ($value) { |
||
26 | $this->node->setAttribute($name, $value); |
||
27 | } |
||
28 | |||
29 | return $this->node->getAttribute($name); |
||
30 | } |
||
31 | } |
||
32 |