ArrayAccess   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
1
<?php
2
3
namespace kalanis\kw_routed_paths\Sources;
4
5
6
/**
7
 * Class ArrayAccess
8
 * @package kalanis\kw_routed_paths\Sources
9
 * Input source is ArrayAccess which provides the path data
10
 * This one is for accessing with simplified inputs
11
 */
12
class ArrayAccess extends Request
13
{
14
    /**
15
     * @param \ArrayAccess<string|int, string|int|float|bool|array<string>> $inputs
16
     * @param string $key
17
     * @param string|null $virtualDir
18
     */
19 2
    public function __construct(\ArrayAccess $inputs, string $key = 'REQUEST_URI', ?string $virtualDir = null)
20
    {
21 2
        $requestUrl = '';
22 2
        if ($inputs->offsetExists($key)) {
23 1
            $requestUrl = strval($inputs->offsetGet($key));
24
        }
25 2
        parent::__construct($requestUrl, $virtualDir);
26 2
    }
27
}
28