Total Complexity | 9 |
Total Lines | 67 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class DocumentMappingView implements DocumentMappingViewInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $type; |
||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | private $parameters = []; |
||
19 | |||
20 | /** |
||
21 | * @return string |
||
22 | */ |
||
23 | public function getType(): ?string |
||
24 | { |
||
25 | return $this->type; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @param string $type |
||
30 | * @return $this |
||
31 | */ |
||
32 | public function setType(string $type) |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @return array |
||
40 | */ |
||
41 | public function getParameters(): array |
||
42 | { |
||
43 | return $this->parameters; |
||
44 | } |
||
45 | |||
46 | public function setParameter(string $parameter, $value): DocumentMappingView |
||
47 | { |
||
48 | $this->parameters[$parameter] = $value; |
||
49 | return $this; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @param array $parameters |
||
54 | * @return $this |
||
55 | */ |
||
56 | public function setParameters(array $parameters) |
||
60 | } |
||
61 | |||
62 | public static function merge(DocumentMappingViewInterface ...$mappings): DocumentMappingView |
||
63 | { |
||
78 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: