PlayerList   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 3 1
A startEmpty() 0 3 1
A count() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\CardGame\ReadModel;
4
5
use Countable;
6
7
final class PlayerList implements Countable
8
{
9
    private $empty = true;
10
11
    public static function startEmpty(): self
12
    {
13
        return new self();
14
    }
15
16
    public function add(): void
17
    {
18
        $this->empty = false;
19
    }
20
21
    public function count(): int
22
    {
23
        // @todo make it an actual list
24
        return (int) !$this->empty;
25
    }
26
}
27