| Conditions | 4 |
| Paths | 5 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 4 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | 4 | public function formatRow($row, AbstractTable $table, $context) |
|
| 20 | { |
||
| 21 | 4 | $cols = $table->getColumns(); |
|
| 22 | 4 | $newRow = []; |
|
| 23 | |||
| 24 | 4 | foreach ($cols as $colIdentifier=>$column) { |
|
| 25 | |||
| 26 | 4 | $rawValue = array_key_exists($colIdentifier, $row) ? $row[$colIdentifier] : ""; |
|
| 27 | |||
| 28 | 4 | if ($column->getOptions()['auto_escape']) { |
|
| 29 | 4 | $value = htmlentities($rawValue, ENT_COMPAT | ENT_HTML401, 'UTF-8'); |
|
| 30 | 4 | } else { |
|
| 31 | 1 | $value = $rawValue; |
|
| 32 | } |
||
| 33 | |||
| 34 | 4 | $colVal = $column->formatCell($value, $row, $context);//Column definition |
|
| 35 | 4 | $newRow[$colIdentifier] = $colVal; |
|
| 36 | 4 | } |
|
| 37 | |||
| 38 | 4 | return $newRow; |
|
| 39 | } |
||
| 40 | } |
||
| 41 |