| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | function df_tools_translation_migrate_initialize_csv($filename) { |
||
| 18 | // Grab the processed CSV file using existing CSV methods. |
||
| 19 | $file = new CSVFileObject($filename); |
||
| 20 | $file->setHeaderRowCount(1); |
||
| 21 | |||
| 22 | // Map the column names (first row) to values. |
||
| 23 | $row = $file->current(); |
||
| 24 | $column_names = []; |
||
| 25 | foreach ($row as $header) { |
||
| 26 | $header = trim($header); |
||
| 27 | $column_names[] = [$header => $header]; |
||
| 28 | } |
||
| 29 | $file->setColumnNames($column_names); |
||
| 30 | |||
| 31 | return $file; |
||
| 32 | } |
||
| 33 |