Completed
Push — master ( 3872f1...3a1160 )
by Greg
11s
created

ListDataFromKeys   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 12
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getListData() 0 4 1
1
<?php
2
namespace Consolidation\OutputFormatters\StructuredData;
3
4
use Consolidation\OutputFormatters\Options\FormatterOptions;
5
6
/**
7
 * Represents aribtrary array data (structured or unstructured) where the
8
 * data to display in --list format comes from the array keys.
9
 */
10
class ListDataFromKeys extends \ArrayObject implements ListDataInterface
11
{
12
    public function __construct($data)
13
    {
14
        parent::__construct($data);
15
    }
16
17
    public function getListData(FormatterOptions $options)
18
    {
19
        return array_keys($this->getArrayCopy());
20
    }
21
}
22