Completed
Push — master ( 3c952e...cb21a4 )
by Greg
11s
created

RowsOfFields::restructure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 4
Bugs 0 Features 1
Metric Value
c 4
b 0
f 1
dl 0
loc 5
ccs 0
cts 0
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
namespace Consolidation\OutputFormatters\StructuredData;
3
4
use Consolidation\OutputFormatters\FormatterOptions;
5
6
/**
7
 * Holds an array where each element of the array is one row,
8
 * and each row contains an associative array where the keys
9
 * are the field names, and the values are the field data.
10
 *
11
 * It is presumed that every row contains the same keys.
12
 */
13
class RowsOfFields extends AbstractStructuredList
14
{
15
    public function restructure(FormatterOptions $options)
16
    {
17
        $data = $this->getArrayCopy();
18
        return $this->createTableTransformation($data, $options);
19
    }
20
21 9
    public function getListData()
22
    {
23 9
        return array_keys($this->getArrayCopy());
24 9
    }
25
}
26