| Conditions | 1 |
| Paths | 1 |
| Total Lines | 7 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 19 | public function onSaving(Topic $topic) |
||
| 20 | { |
||
| 21 | $topic->title = Purifier::clean($topic->title, 'title'); |
||
| 22 | $topic->body_original = Purifier::clean(trim($topic->body), 'body'); |
||
| 23 | $topic->body = app('markdown')->text($topic->body_original); |
||
| 24 | $topic->excerpt = str_limit(trim(preg_replace('/\s+/', ' ', strip_tags($topic->body))), 200); |
||
| 25 | } |
||
| 26 | |||
| 40 |
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.