| Conditions | 4 |
| Paths | 5 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | protected function failureDescription($other): string |
||
| 33 | { |
||
| 34 | 1 | if ($other->is_root()) { |
|
| 35 | $node_string = 'HTML page'; |
||
| 36 | 1 | } else { |
|
| 37 | 1 | $node_string = $other->tag_name(); |
|
| 38 | |||
| 39 | 1 | if ($id = $other->attribute('id')) { |
|
| 40 | $node_string .= '#'.$id; |
||
| 41 | 1 | } |
|
| 42 | 1 | ||
| 43 | if ($class = $other->attribute('class')) { |
||
| 44 | $node_string .= '.'.implode('.', explode(' ', $class)); |
||
| 45 | 1 | } |
|
| 46 | 1 | } |
|
| 47 | |||
| 48 | return "$node_string ".$this->toString(); |
||
| 49 | } |
||
| 50 | 1 | ||
| 59 |