Character::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace JeroenDesloovere\CharacterCollection;
4
5
class Character
6
{
7
    /** @var string */
8
    private $value;
9
10
    /** @var array */
11
    private $positions;
12
13
    public function __construct(string $value)
14
    {
15
        $this->value = $value;
16
    }
17
18
    public function addPosition(int $position)
19
    {
20
        $this->positions[] = $position;
21
    }
22
23
    public function getPositions(): array
24
    {
25
        return $this->positions;
26
    }
27
28
    public function getValue(): string
29
    {
30
        return $this->value;
31
    }
32
}
33