VisitedPage::source()   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
final class VisitedPage implements VisitorEvent
6
{
7
    private $visitor;
8
    private $page;
9
    private $source;
10
    private $firstVisit;
11
12
    public function __construct(
13
        VisitorId $visitor,
14
        string $page,
15
        string $redirectSource,
16
        bool $firstVisit
17
    ) {
18
        $this->visitor = $visitor;
19
        $this->page = $page;
20
        $this->source = $redirectSource;
21
        $this->firstVisit = $firstVisit;
22
    }
23
24
    public function aggregateId(): VisitorId
25
    {
26
        return $this->visitor;
27
    }
28
29
    public function page(): string
30
    {
31
        return $this->page;
32
    }
33
34
    public function source(): string
35
    {
36
        return $this->source;
37
    }
38
39
    public function isFirstVisit(): bool
40
    {
41
        return $this->firstVisit;
42
    }
43
}
44