VisitedPage   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
c 0
b 0
f 0
dl 0
loc 37
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A aggregateId() 0 3 1
A source() 0 3 1
A isFirstVisit() 0 3 1
A page() 0 3 1
A __construct() 0 10 1
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