Completed
Push — master ( 3feeea...9fb957 )
by David de
04:08
created

ArrayReader::getFields()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
ccs 3
cts 4
cp 0.75
rs 9.6666
cc 2
eloc 4
nc 2
nop 0
crap 2.0625
1
<?php
2
3
namespace Ddeboer\DataImport\Reader;
4
5
/**
6
 * Reads an array
7
 *
8
 * @author David de Boer <[email protected]>
9
 */
10
class ArrayReader extends \ArrayIterator implements CountableReader
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15 1
    public function getFields()
16
    {
17
        // Examine first row
18 1
        if ($this->count() > 0) {
19 1
            return array_keys($this[0]);
20
        }
21
22
        return [];
23
    }
24
}
25