Inputs   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
eloc 4
c 2
b 0
f 1
dl 0
loc 7
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
1
<?php
2
3
namespace kalanis\kw_address_handler\Sources;
4
5
6
use kalanis\kw_input\Interfaces\IEntry;
7
use kalanis\kw_input\Interfaces\IFiltered;
8
9
10
/**
11
 * Class Inputs
12
 * @package kalanis\kw_address_handler\Sources
13
 * Construct object is inputs datasource which provides the address
14
 * @codeCoverageIgnore access external variable
15
 */
16
class Inputs extends Sources
17
{
18
    public function __construct(IFiltered $inputs, string $entry = 'REQUEST_URI')
19
    {
20
        $server = $inputs->getInArray($entry, [IEntry::SOURCE_SERVER]);
21
        if (isset($server[$entry])) {
22
            $this->setAddress(strval($server[$entry]));
23
        }
24
    }
25
}
26