CSV   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A array() 0 3 1
1
<?php
2
3
namespace HexMakina\LocalFS\Text;
4
5
class CSV extends TextFile
6
{
7
8
9
  // T — Gets line from file pointer and parse for CSV fields
10
  // fgetcsv ( resource $handle [, int $length = 0 [, string $delimiter = "," [, string $enclosure = '"' [, string $escape = "\\" ]]]] ) : array
11
12
  // fputcsv ( resource $handle , array $fields [, string $delimiter = "," [, string $enclosure = '"' [, string $escape_char = "\\" ]]] ) : int
13
  /*
14
<?php
15
16
$list = array (
17
    array('aaa', 'bbb', 'ccc', 'dddd'),
18
    array('123', '456', '789'),
19
    array('"aaa"', '"bbb"')
20
);
21
22
$fp = fopen('file.csv', 'w');
23
24
foreach ($list as $fields) {
25
    fputcsv($fp, $fields);
26
}
27
28
fclose($fp);
29
30
31
*/
32
    function array() : array
33
    {
34
        return array_map('str_getcsv', parent::array());
35
    }
36
}
37