Passed
Push — dev ( 40f0b5...3a2e98 )
by Fike
02:50
created

Context   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 45
c 0
b 0
f 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setPreserveUnknownOptions() 0 4 1
A getPreservedOptions() 0 3 1
A setPreservedOptions() 0 4 1
A shouldPreserveUnknownOptions() 0 3 1
1
<?php
2
3
namespace AmaTeam\ElasticSearch\API\Indexing\Normalization;
4
5
class Context implements ContextInterface
6
{
7
    /**
8
     * @var bool
9
     */
10
    private $preserveUnknownOptions = false;
11
    /**
12
     * @var string[]
13
     */
14
    private $preservedOptions = [];
15
16
    /**
17
     * @return bool
18
     */
19
    public function shouldPreserveUnknownOptions(): bool
20
    {
21
        return $this->preserveUnknownOptions;
22
    }
23
24
    /**
25
     * @param bool $preserveUnknownOptions
26
     * @return $this
27
     */
28
    public function setPreserveUnknownOptions(bool $preserveUnknownOptions): Context
29
    {
30
        $this->preserveUnknownOptions = $preserveUnknownOptions;
31
        return $this;
32
    }
33
34
    /**
35
     * @return string[]
36
     */
37
    public function getPreservedOptions(): array
38
    {
39
        return $this->preservedOptions;
40
    }
41
42
    /**
43
     * @param string[] $preservedOptions
44
     * @return $this
45
     */
46
    public function setPreservedOptions(array $preservedOptions): Context
47
    {
48
        $this->preservedOptions = $preservedOptions;
49
        return $this;
50
    }
51
}
52