ArrayReader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 15
rs 10
c 0
b 0
f 0
ccs 3
cts 4
cp 0.75

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFields() 0 9 2
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