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

Context::setPreserveUnknownEntries()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace AmaTeam\ElasticSearch\API\Entity\Normalization;
4
5 View Code Duplication
class Context implements ContextInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
6
{
7
    /**
8
     * @var string[]
9
     */
10
    private $preservedIndexingOptions = [];
11
    /**
12
     * @var string[]
13
     */
14
    private $preservedMappingParameters = [];
15
    /**
16
     * @var bool
17
     */
18
    private $preserveUnknownEntries = false;
19
20
    /**
21
     * @return string[]
22
     */
23
    public function getPreservedIndexingOptions(): array
24
    {
25
        return $this->preservedIndexingOptions;
26
    }
27
28
    /**
29
     * @param string[] $preservedIndexingOptions
30
     * @return $this
31
     */
32
    public function setPreservedIndexingOptions(array $preservedIndexingOptions): Context
33
    {
34
        $this->preservedIndexingOptions = $preservedIndexingOptions;
35
        return $this;
36
    }
37
38
    /**
39
     * @return string[]
40
     */
41
    public function getPreservedMappingParameters(): array
42
    {
43
        return $this->preservedMappingParameters;
44
    }
45
46
    /**
47
     * @param string[] $preservedMappingParameters
48
     * @return $this
49
     */
50
    public function setPreservedMappingParameters(array $preservedMappingParameters): Context
51
    {
52
        $this->preservedMappingParameters = $preservedMappingParameters;
53
        return $this;
54
    }
55
56
    /**
57
     * @return bool
58
     */
59
    public function shouldPreserveUnknownEntries(): bool
60
    {
61
        return $this->preserveUnknownEntries;
62
    }
63
64
    /**
65
     * @param bool $preserveUnknownEntries
66
     * @return $this
67
     */
68
    public function setPreserveUnknownEntries(bool $preserveUnknownEntries): Context
69
    {
70
        $this->preserveUnknownEntries = $preserveUnknownEntries;
71
        return $this;
72
    }
73
}
74