Conditions | 4 |
Paths | 5 |
Total Lines | 22 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
33 | 1 | public function failureDescription($other) |
|
34 | { |
||
35 | 1 | if ($other->is_root()) |
|
36 | { |
||
37 | 1 | $node_string = 'HTML page'; |
|
38 | } |
||
39 | else |
||
40 | { |
||
41 | 1 | $node_string = $other->tag_name(); |
|
42 | |||
43 | 1 | if ($id = $other->attribute('id')) |
|
44 | { |
||
45 | 1 | $node_string .= '#'.$id; |
|
46 | } |
||
47 | |||
48 | 1 | if ($class = $other->attribute('class')) |
|
49 | { |
||
50 | 1 | $node_string .= '.'.join('.', explode(' ', $class)); |
|
51 | } |
||
52 | } |
||
53 | 1 | return "$node_string ".$this->toString(); |
|
54 | } |
||
55 | |||
66 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.