Visit::redirectSource()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\CardGame\Visiting;
4
5
use Stratadox\CardGame\Command;
6
use Stratadox\CardGame\CorrelationId;
7
8
final class Visit implements Command
9
{
10
    private $page;
11
    private $redirectSource;
12
    private $visitorId;
13
    private $correlationId;
14
15
    private function __construct(
16
        string $page,
17
        string $redirectSource,
18
        VisitorId $visitorId,
19
        CorrelationId $correlationId
20
    ) {
21
        $this->page = $page;
22
        $this->redirectSource = $redirectSource;
23
        $this->visitorId = $visitorId;
24
        $this->correlationId = $correlationId;
25
    }
26
27
    public static function page(
28
        string $page,
29
        string $redirectSource,
30
        VisitorId $visitorId,
31
        CorrelationId $correlationId
32
    ): self {
33
        return new self($page, $redirectSource, $visitorId, $correlationId);
34
    }
35
36
    public function whichPage(): string
37
    {
38
        return $this->page;
39
    }
40
41
    public function redirectSource(): string
42
    {
43
        return $this->redirectSource;
44
    }
45
46
    public function visitorId(): VisitorId
47
    {
48
        return $this->visitorId;
49
    }
50
51
    public function correlationId(): CorrelationId
52
    {
53
        return $this->correlationId;
54
    }
55
}
56