| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 27 | 3 | public function convert($item) |
|
| 28 | { |
||
| 29 | 3 | if ($this->header === null) { |
|
| 30 | 2 | $this->header = $item; |
|
| 31 | |||
| 32 | 2 | return $item; |
|
| 33 | } |
||
| 34 | |||
| 35 | 2 | $newItem = []; |
|
| 36 | 2 | foreach ($item as $key => $value) { |
|
| 37 | 2 | if (isset($this->header[$key])) { |
|
| 38 | 2 | $key = $this->header[$key]; |
|
| 39 | 2 | } |
|
| 40 | 2 | $newItem[$key] = $value; |
|
| 41 | 2 | } |
|
| 42 | |||
| 43 | 2 | return $newItem; |
|
| 44 | } |
||
| 45 | } |
||
| 46 |