InputArray::__construct()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 2
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 4
rs 10
ccs 3
cts 3
cp 1
crap 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