@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | public function mergeCount($count_data) |
51 | 51 | { |
52 | 52 | $tree = isset($this->tree) ? $this->tree : []; |
53 | - $this->addMergeCount($tree,$count_data); |
|
53 | + $this->addMergeCount($tree, $count_data); |
|
54 | 54 | /* |
55 | 55 | foreach ($tree as &$rec) { |
56 | 56 | foreach ($count_data as $count) { |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | $this->tree = $tree; |
70 | 70 | } |
71 | 71 | |
72 | - public function addMergeCount(&$tree,$count_data) |
|
72 | + public function addMergeCount(&$tree, $count_data) |
|
73 | 73 | { |
74 | - foreach ( $tree as &$rec ) { |
|
75 | - foreach ( $count_data as $count ) { |
|
74 | + foreach ($tree as &$rec) { |
|
75 | + foreach ($count_data as $count) { |
|
76 | 76 | if (isset($count->id) === false) { |
77 | 77 | throw new Exception('count data record object does not have property => "id".'); |
78 | 78 | } |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | if ($rec->id == $count->id) { |
83 | 83 | $rec->count = $count->count; |
84 | 84 | } |
85 | - if ( count($rec->children) ) { |
|
86 | - $this->addMergeCount($rec->children,$count_data); |
|
85 | + if (count($rec->children)) { |
|
86 | + $this->addMergeCount($rec->children, $count_data); |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 | } |