StartTheMatch   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A forProposal() 0 5 1
A __construct() 0 4 1
A proposal() 0 3 1
A correlationId() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\CardGame\Match\Command;
4
5
use Stratadox\CardGame\Command;
6
use Stratadox\CardGame\CorrelationId;
7
use Stratadox\CardGame\Proposal\ProposalId;
8
9
final class StartTheMatch implements Command
10
{
11
    private $proposal;
12
    private $correlationId;
13
14
    private function __construct(ProposalId $proposal, CorrelationId $correlationId)
15
    {
16
        $this->proposal = $proposal;
17
        $this->correlationId = $correlationId;
18
    }
19
20
    public static function forProposal(
21
        ProposalId $proposal,
22
        CorrelationId $correlationId
23
    ): self {
24
        return new self($proposal, $correlationId);
25
    }
26
27
    public function proposal(): ProposalId
28
    {
29
        return $this->proposal;
30
    }
31
32
    public function correlationId(): CorrelationId
33
    {
34
        return $this->correlationId;
35
    }
36
}
37