Completed
Push — master ( 4b1e3c...30d3d2 )
by Jesse
02:57
created

Card::id()   A

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\ReadModel\Match;
4
5
final class Card
6
{
7
    private $id;
8
    private $attacking = false;
9
10
    public function __construct(string $id)
11
    {
12
        $this->id = $id;
13
    }
14
15
    public function type(): string
16
    {
17
        return $this->id;
18
    }
19
20
    public function is(Card $theOther): bool
21
    {
22
        return $this->id === $theOther->id;
23
    }
24
25
    public function isAttacking(): bool
26
    {
27
        return $this->attacking;
28
    }
29
30
    public function attack(): void
31
    {
32
        $this->attacking = true;
33
    }
34
}
35