VisitorOpenedAnAccount   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 26
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A with() 0 5 1
A aggregateId() 0 3 1
A __construct() 0 4 1
A forVisitor() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\CardGame\Account;
4
5
use Stratadox\CardGame\Visiting\VisitorId;
6
7
final class VisitorOpenedAnAccount implements AccountEvent
8
{
9
    private $playerId;
10
    private $visitorId;
11
12
    private function __construct(AccountId $forPlayer, VisitorId $fromVisitor)
13
    {
14
        $this->playerId = $forPlayer;
15
        $this->visitorId = $fromVisitor;
16
    }
17
18
    public static function with(
19
        AccountId $id,
20
        VisitorId $visitorId
21
    ): AccountEvent {
22
        return new self($id, $visitorId);
23
    }
24
25
    public function aggregateId(): AccountId
26
    {
27
        return $this->playerId;
28
    }
29
30
    public function forVisitor(): VisitorId
31
    {
32
        return $this->visitorId;
33
    }
34
}
35