Header   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 31
ccs 3
cts 5
cp 0.6
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getHeaderSignature() 0 4 1
1
<?php
2
3
namespace CHMLib\Header;
4
5
use CHMLib\Reader\Reader;
6
7
/**
8
 * A generic header.
9
 */
10
abstract class Header
11
{
12
    /**
13
     * The header signature.
14
     *
15
     * @var string
16
     */
17
    protected $headerSignature;
18
19
    /**
20
     * Initialize the instance.
21
     *
22
     * @param Reader $reader The reader that provides the data.
23
     *
24
     * @throws \Exception Throws an Exception in case of errors.
25
     */
26 4
    public function __construct(Reader $reader)
27
    {
28 4
        $this->headerSignature = $reader->readString(4);
29 4
    }
30
31
    /**
32
     * Get the header signature.
33
     *
34
     * @return string
35
     */
36
    public function getHeaderSignature()
37
    {
38
        return $this->headerSignature;
39
    }
40
}
41