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

ListDataFromKeys::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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