| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 59 | 2 | public function categorizeItem( $vals, $item ) { |
|
| 60 | 2 | foreach ( $vals as $val ) { |
|
| 61 | 2 | if ( array_key_exists( $val, $this->tree ) ) { |
|
| 62 | 2 | $this->tree[$val]->items[] = $item; |
|
| 63 | 2 | $this->tree[$val]->leafCount++; |
|
| 64 | } else { |
||
| 65 | 2 | $this->tree[$val] = new self( [ $item ] ); |
|
| 66 | 2 | $this->tree[$val]->leafCount++; |
|
| 67 | } |
||
| 68 | } |
||
| 69 | 2 | } |
|
| 70 | |||
| 91 |