| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | 5 | protected function addTree(&$tree,$data) |
|
| 34 | {
|
||
| 35 | 5 | foreach ( $tree as $id => &$rec ) {
|
|
| 36 | 5 | if ( $data->parent_id == $id ) {
|
|
| 37 | 5 | $data->children = []; |
|
| 38 | 5 | $rec->children[$data->id] = $data; |
|
| 39 | 5 | return; |
|
| 40 | 5 | } elseif ( count($rec->children) ) {
|
|
| 41 | 5 | $this->addTree($rec->children,$data); |
|
| 42 | 5 | } |
|
| 43 | 5 | unset($rec); |
|
| 44 | 5 | } |
|
| 45 | 5 | } |
|
| 46 | 4 | public function mergeCount($count_data) |
|
| 62 |