Completed
Pull Request — master (#20)
by Greg
03:00
created

RowsOfFields   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 7
Bugs 0 Features 3
Metric Value
wmc 2
c 7
b 0
f 3
lcom 1
cbo 1
dl 0
loc 13
ccs 3
cts 3
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A restructure() 0 5 1
A getListData() 0 4 1
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