Total Complexity | 12 |
Total Lines | 90 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class PropertyMappingView implements PropertyMappingViewInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var string|null |
||
11 | */ |
||
12 | private $type; |
||
13 | /** |
||
14 | * @var string|null |
||
15 | */ |
||
16 | private $targetClass; |
||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | private $parameters = []; |
||
21 | |||
22 | /** |
||
23 | * @return null|string |
||
24 | */ |
||
25 | public function getType(): ?string |
||
26 | { |
||
27 | return $this->type; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @param null|string $type |
||
32 | * @return $this |
||
33 | */ |
||
34 | public function setType(string $type) |
||
35 | { |
||
36 | $this->type = $type; |
||
37 | return $this; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @return null|string |
||
42 | */ |
||
43 | public function getTargetClass(): ?string |
||
44 | { |
||
45 | return $this->targetClass; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param null|string $targetClass |
||
50 | * @return $this |
||
51 | */ |
||
52 | public function setTargetClass(string $targetClass) |
||
53 | { |
||
54 | $this->targetClass = $targetClass; |
||
55 | return $this; |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return array |
||
60 | */ |
||
61 | public function getParameters(): array |
||
62 | { |
||
63 | return $this->parameters; |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * @param array $parameters |
||
68 | * @return $this |
||
69 | */ |
||
70 | public function setParameters(array $parameters) |
||
71 | { |
||
72 | $this->parameters = $parameters; |
||
73 | return $this; |
||
74 | } |
||
75 | |||
76 | public function setParameter(string $name, $value): PropertyMappingView |
||
80 | } |
||
81 | |||
82 | public static function merge(PropertyMappingViewInterface ...$views): PropertyMappingView |
||
97 | } |
||
98 | } |
||
99 |
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: