Character   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 28
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A addPosition() 0 4 1
A getPositions() 0 4 1
A getValue() 0 4 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