Passed
Push — master ( ed8f97...95efe5 )
by Chema
03:24
created

CNTControl   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 25
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A subSegmentKey() 0 3 1
A __construct() 0 3 1
A name() 0 3 1
A rawValues() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EdifactParser\Segments;
6
7
namespace EdifactParser\Segments;
8
9
final class CNTControl implements SegmentInterface
10
{
11
    public const NAME = 'CNT';
12
13
    /** @var array */
14
    private $rawValues;
15
16 5
    public function __construct(array $rawValues)
17
    {
18 5
        $this->rawValues = $rawValues;
19 5
    }
20
21 5
    public function name(): string
22
    {
23 5
        return self::NAME;
24
    }
25
26 5
    public function subSegmentKey(): string
27
    {
28 5
        return $this->rawValues[1][0];
29
    }
30
31 2
    public function rawValues(): array
32
    {
33 2
        return $this->rawValues;
34
    }
35
}
36