Passed
Push — feature/initial-implementation ( 0c2c6c...79751f )
by Fike
01:54
created

Mapping   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
dl 0
loc 73
rs 10
c 1
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setType() 0 4 1
A setParameter() 0 4 1
A getProperties() 0 3 1
A setParameters() 0 4 1
A setProperties() 0 4 1
A getParameters() 0 3 1
A getType() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AmaTeam\ElasticSearch\Mapping;
6
7
use AmaTeam\ElasticSearch\API\Mapping\MappingInterface;
8
9
class Mapping implements MappingInterface
10
{
11
    /**
12
     * @var string
13
     */
14
    private $type;
15
    /**
16
     * @var array
17
     */
18
    private $parameters = [];
19
    /**
20
     * @var MappingInterface[]
21
     */
22
    private $properties = [];
23
24
    /**
25
     * @return string
26
     */
27
    public function getType(): string
28
    {
29
        return $this->type;
30
    }
31
32
    /**
33
     * @param string $type
34
     * @return $this
35
     */
36
    public function setType(string $type)
37
    {
38
        $this->type = $type;
39
        return $this;
40
    }
41
42
    /**
43
     * @return array
44
     */
45
    public function getParameters(): array
46
    {
47
        return $this->parameters;
48
    }
49
50
    /**
51
     * @param array $parameters
52
     * @return $this
53
     */
54
    public function setParameters(array $parameters)
55
    {
56
        $this->parameters = $parameters;
57
        return $this;
58
    }
59
60
    public function setParameter(string $parameter, $value)
61
    {
62
        $this->parameters[$parameter] = $value;
63
        return $this;
64
    }
65
66
    /**
67
     * @return MappingInterface[]
68
     */
69
    public function getProperties(): array
70
    {
71
        return $this->properties;
72
    }
73
74
    /**
75
     * @param MappingInterface[] $properties
76
     * @return $this
77
     */
78
    public function setProperties(array $properties)
79
    {
80
        $this->properties = $properties;
81
        return $this;
82
    }
83
}
84