ArrayLoader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 9 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