Header   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 40
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getData() 0 3 1
A getOptions() 0 3 1
A mustUnderstand() 0 5 1
A asMustUnderstand() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GoetasWebservices\SoapServices\Metadata\Headers;
6
7
class Header
8
{
9
    /**
10
     * @var object
11
     */
12
    private $data;
13
    /**
14
     * @var array
15
     */
16
    private $options = [];
17
18
    public function __construct(object $data, array $options = [])
19
    {
20
        $this->data = $data;
21
        $this->options = $options;
22
    }
23
24
    public static function asMustUnderstand(object $data): Header
25
    {
26
        $header = new Header($data);
27
        $header->mustUnderstand();
28
29
        return $header;
30
    }
31
32
    public function getData(): object
33
    {
34
        return $this->data;
35
    }
36
37
    public function getOptions(): array
38
    {
39
        return $this->options;
40
    }
41
42
    public function mustUnderstand(): Header
43
    {
44
        $this->options['mustUnderstand'] = true;
45
46
        return $this;
47
    }
48
}
49