| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | 81 | public static function attributes(array $attributes): string |
|
| 20 | { |
||
| 21 | 81 | $out = ''; |
|
| 22 | |||
| 23 | 81 | foreach ($attributes as $k => $v) { |
|
| 24 | 81 | if ($v === false) { |
|
| 25 | 56 | continue; |
|
| 26 | } |
||
| 27 | |||
| 28 | 81 | $out .= ' '.htmlentities($k); |
|
| 29 | |||
| 30 | 81 | if ($v !== true) { |
|
| 31 | 81 | $out .= '="'.htmlentities((string) $v).'"'; |
|
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | 81 | return $out; |
|
| 36 | } |
||
| 58 |