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

Redirect::method()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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