| Conditions | 6 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 11 | public function parse(Notification $notification) |
||
| 12 | { |
||
| 13 | $text = $notification->template_body; |
||
|
|
|||
| 14 | |||
| 15 | $specialValues = $this->getValues($text); |
||
| 16 | if (count($specialValues) > 0) { |
||
| 17 | $specialValues = array_filter($specialValues, function ($value) use ($notification) { |
||
| 18 | return isset($notification->$value) || starts_with($value, ['extra.', 'to.', 'from.']); |
||
| 19 | }); |
||
| 20 | |||
| 21 | foreach ($specialValues as $replacer) { |
||
| 22 | $replace = notifynder_mixed_get($notification, $replacer); |
||
| 23 | if (empty($replace) && notifynder_config()->isStrict()) { |
||
| 24 | throw new ExtraParamsException("The following [$replacer] param required from your category is missing."); |
||
| 25 | } |
||
| 26 | $text = $this->replace($text, $replace, $replacer); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | return $text; |
||
| 31 | } |
||
| 32 | |||
| 45 | } |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.