Completed
Push — master ( 7b9015...c5b311 )
by Vladimir
26s queued 11s
created

RedirectMapper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 37.5%

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
ccs 3
cts 8
cp 0.375
wmc 3
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A registerRedirect() 0 4 1
A getRedirects() 0 4 1
1
<?php
2
3
namespace allejo\stakx;
4
5
class RedirectMapper
6
{
7
    /** @var array<string, string> */
8
    private $urlMap;
9
10 12
    public function __construct()
11
    {
12 12
        $this->urlMap = [];
13 12
    }
14
15
    public function registerRedirect($from, $to)
16
    {
17
        $this->urlMap[$from] = $to;
18
    }
19
20
    public function getRedirects()
21
    {
22
        return $this->urlMap;
23
    }
24
}
25