PlayerList::count()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
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