AcceptTheProposal::correlationId()   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\Proposal;
4
5
use Stratadox\CardGame\Account\AccountId;
6
use Stratadox\CardGame\Command;
7
use Stratadox\CardGame\CorrelationId;
8
9
final class AcceptTheProposal implements Command
10
{
11
    private $proposalId;
12
    private $acceptingPlayer;
13
    private $correlationId;
14
15
    private function __construct(
16
        ProposalId $id,
17
        AccountId $acceptingPlayer,
18
        CorrelationId $correlationId
19
    ) {
20
        $this->proposalId = $id;
21
        $this->acceptingPlayer = $acceptingPlayer;
22
        $this->correlationId = $correlationId;
23
    }
24
25
    public static function withId(
26
        ProposalId $id,
27
        AccountId $acceptingPlayer,
28
        CorrelationId $correlationId
29
    ): self {
30
        return new self($id, $acceptingPlayer, $correlationId);
31
    }
32
33
    public function proposal(): ProposalId
34
    {
35
        return $this->proposalId;
36
    }
37
38
    public function acceptingPlayer(): AccountId
39
    {
40
        return $this->acceptingPlayer;
41
    }
42
43
    public function correlationId(): CorrelationId
44
    {
45
        return $this->correlationId;
46
    }
47
}
48