TestCase   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 10
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildCsvFromArray() 0 7 2
1
<?php
2
3
namespace LogikosTest\Csv\CsvToMysql;
4
5
class TestCase extends \PHPUnit\Framework\TestCase {
6
7
  protected function buildCsvFromArray($data) {
8
    $tmpfname = tempnam(sys_get_temp_dir(), 'csvimport-');
9
    $handle = fopen($tmpfname, 'w');
10
    foreach ($data as $fields) fputcsv($handle, $fields);
11
    fclose($handle);
12
    return $tmpfname;
13
  }
14
}