ArrayLoader::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rs\XmlFilter\Loader;
6
7
class ArrayLoader implements Loader
8
{
9
    /**
10
     * @var array
11
     */
12
    private $content = [];
13
14 10
    public function __construct(array $content)
15
    {
16 10
        $this->content = $content;
17 10
    }
18
19 8
    public function __invoke() : array
20
    {
21 8
        reset($this->content);
22
23
        return [
24 8
            'filter'  => key($this->content),
25 8
            'options' => current($this->content),
26
        ];
27
    }
28
}
29