1 | <?php declare(strict_types=1); |
||
32 | class Rule implements RuleInterface |
||
33 | { |
||
34 | /** |
||
35 | * @var string|null |
||
36 | */ |
||
37 | private $name; |
||
38 | |||
39 | /** |
||
40 | * @var TargetInterface|null |
||
41 | */ |
||
42 | private $target; |
||
43 | |||
44 | /** |
||
45 | * @var MethodInterface|null |
||
46 | */ |
||
47 | private $condition; |
||
48 | |||
49 | /** |
||
50 | * @var MethodInterface|null |
||
51 | */ |
||
52 | private $effect; |
||
53 | |||
54 | /** |
||
55 | * @var ObligationInterface[] |
||
56 | */ |
||
57 | private $obligations; |
||
58 | |||
59 | /** |
||
60 | * @var AdviceInterface[] |
||
61 | */ |
||
62 | private $advice; |
||
63 | |||
64 | /** |
||
65 | * @param null|string $name |
||
66 | * @param TargetInterface|null $target |
||
67 | * @param MethodInterface|null $condition |
||
68 | 36 | * @param MethodInterface|null $effect |
|
69 | * @param ObligationInterface[] $obligations |
||
70 | * @param AdviceInterface[] $advice |
||
71 | */ |
||
72 | public function __construct( |
||
83 | 36 | ||
84 | /** |
||
85 | 36 | * @inheritdoc |
|
86 | */ |
||
87 | public function getName(): ?string |
||
91 | |||
92 | /** |
||
93 | 36 | * @param null|string $name |
|
94 | * |
||
95 | 36 | * @return self |
|
96 | */ |
||
97 | 36 | public function setName(?string $name): self |
|
103 | 36 | ||
104 | /** |
||
105 | 36 | * @inheritdoc |
|
106 | */ |
||
107 | public function getTarget(): ?TargetInterface |
||
111 | |||
112 | /** |
||
113 | 36 | * @param TargetInterface|null $target |
|
114 | * |
||
115 | 36 | * @return self |
|
116 | */ |
||
117 | 36 | public function setTarget(?TargetInterface $target): self |
|
123 | 36 | ||
124 | /** |
||
125 | 36 | * @inheritdoc |
|
126 | */ |
||
127 | public function getCondition(): ?MethodInterface |
||
131 | |||
132 | /** |
||
133 | 36 | * @param MethodInterface|null $condition |
|
134 | * |
||
135 | 36 | * @return self |
|
136 | */ |
||
137 | 36 | public function setCondition(?MethodInterface $condition): self |
|
143 | 36 | ||
144 | /** |
||
145 | 36 | * @inheritdoc |
|
146 | */ |
||
147 | public function effect(): ?MethodInterface |
||
151 | |||
152 | /** |
||
153 | 36 | * @param MethodInterface $effect |
|
154 | * |
||
155 | 36 | * @return self |
|
156 | */ |
||
157 | 36 | public function setEffect(?MethodInterface $effect): self |
|
163 | 36 | ||
164 | /** |
||
165 | 36 | * @inheritdoc |
|
166 | */ |
||
167 | public function getObligations(): array |
||
171 | |||
172 | /** |
||
173 | 36 | * @param ObligationInterface[] $obligations |
|
174 | * |
||
175 | * @return self |
||
176 | 36 | */ |
|
177 | public function setObligations(array $obligations): self |
||
193 | 36 | ||
194 | /** |
||
195 | 36 | * @inheritdoc |
|
196 | */ |
||
197 | public function getAdvice(): array |
||
201 | |||
202 | /** |
||
203 | 36 | * @param AdviceInterface[] $advice |
|
204 | * |
||
205 | * @return self |
||
206 | 36 | */ |
|
207 | public function setAdvice(array $advice): self |
||
223 | } |
||
224 |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):