InputArray   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 3
c 1
b 0
f 0
dl 0
loc 10
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 3
1
<?php
2
3
namespace kalanis\kw_address_handler\Sources;
4
5
6
use ArrayAccess;
7
8
9
/**
10
 * Class InputArray
11
 * @package kalanis\kw_address_handler\Sources
12
 * Construct object is inputs datasource which provides the address
13
 */
14
class InputArray extends Sources
15
{
16
    /**
17
     * @param ArrayAccess<string|int, string|int> $inputs
18
     * @param string $entry
19
     */
20 1
    public function __construct(ArrayAccess $inputs, string $entry = 'REQUEST_URI')
21
    {
22 1
        if ($inputs->offsetExists($entry) && '' != $inputs->offsetGet($entry)) {
23 1
            $this->setAddress(strval($inputs->offsetGet($entry)));
24
        }
25 1
    }
26
}
27