Passed
Pull Request — main (#6)
by Chema
02:41
created

Redirect   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 60%

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A uri() 0 3 1
A destination() 0 3 1
A __construct() 0 6 1
A method() 0 3 1
A status() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Router;
6
7
final class Redirect
8
{
9 12
    public function __construct(
10
        private string $uri,
11
        private string $destination,
12
        private string $method = Request::METHOD_GET,
13
        private int $status = 302,
14
    ) {
15 12
    }
16
17
    public function uri(): string
18
    {
19
        return $this->uri;
20
    }
21
22 11
    public function destination(): string
23
    {
24 11
        return $this->destination;
25
    }
26
27
    public function status(): int
28
    {
29
        return $this->status;
30
    }
31
32 11
    public function method(): string
33
    {
34 11
        return $this->method;
35
    }
36
}
37