Conditions | 5 |
Paths | 5 |
Total Lines | 28 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 0 |
1 | <?php |
||
34 | public function generate(array $bc_breaks) |
||
35 | { |
||
36 | if ( !$bc_breaks ) { |
||
37 | return 'No backwards compatibility breaks detected.'; |
||
38 | } |
||
39 | |||
40 | $ret = 'Backward compatibility breaks:' . PHP_EOL; |
||
41 | |||
42 | foreach ( $this->groupByType($bc_breaks) as $bc_break => $incidents ) { |
||
43 | $ret .= PHP_EOL; |
||
44 | |||
45 | $bc_break = ucwords(str_replace(array('.', '_'), ' ', $bc_break)); |
||
46 | $ret .= '<fg=red>=== ' . $bc_break . ' (' . count($incidents) . ') ===</>' . PHP_EOL; |
||
47 | |||
48 | foreach ( $incidents as $incident_data ) { |
||
49 | if ( array_key_exists('old', $incident_data) ) { |
||
50 | $ret .= ' * <fg=white;options=bold>' . $incident_data['element'] . '</>' . PHP_EOL; |
||
51 | $ret .= ' OLD: ' . $incident_data['old'] . PHP_EOL; |
||
52 | $ret .= ' NEW: ' . $incident_data['new'] . PHP_EOL; |
||
53 | } |
||
54 | else { |
||
55 | $ret .= ' * ' . $incident_data['element'] . PHP_EOL; |
||
56 | } |
||
57 | } |
||
58 | } |
||
59 | |||
60 | return $ret; |
||
61 | } |
||
62 | |||
64 |