GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Setup Failed
Push — 8.x-4.x-translate ( d1297f )
by Kevin
09:09
created

df_tools_translation_migrate_initialize_csv()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 9
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 15
rs 9.9666
1
<?php
2
3
/**
4
 * @file
5
 * Contains df_tools_translation_migrate.module.
6
 */
7
8
use Drupal\migrate_source_csv\CSVFileObject;
9
10
/**
11
 * Performs minimum steps necessary to load a CSV from a file.
12
 *
13
 * @param string $filename The filename of a CSV
14
 *
15
 * @return \Drupal\migrate_source_csv\CSVFileObject The prepared CSV object
16
 */
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