| Conditions | 5 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | 12 | public function __invoke(\DOMElement $svg, array $options = []): \DOMElement |
|
| 26 | { |
||
| 27 | 12 | foreach ($options as $key => $val) { |
|
| 28 | 12 | if (in_array($key, $this->blocked)) { |
|
| 29 | // Delete option attribute |
||
| 30 | 12 | $svg->removeAttribute($key); |
|
| 31 | 12 | } elseif ($val = is_string($val) ? $val : null) { |
|
| 32 | // Set option attribute after clean |
||
| 33 | 12 | $svg->removeAttribute($key); |
|
| 34 | 12 | $svg->setAttribute($key, $val); |
|
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | 12 | return $svg; |
|
| 39 | } |
||
| 41 |