Conditions | 4 |
Paths | 5 |
Total Lines | 22 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function failureDescription($other) |
||
34 | { |
||
35 | if ($other->is_root()) |
||
36 | { |
||
37 | $node_string = 'HTML page'; |
||
38 | } |
||
39 | else |
||
40 | { |
||
41 | $node_string = $other->tag_name(); |
||
42 | |||
43 | if ($id = $other->attribute('id')) |
||
44 | { |
||
45 | $node_string .= '#'.$id; |
||
46 | } |
||
47 | |||
48 | if ($class = $other->attribute('class')) |
||
49 | { |
||
50 | $node_string .= '.'.join('.', explode(' ', $class)); |
||
51 | } |
||
52 | } |
||
53 | 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.