1 | <?php |
||
15 | class CommentObserver |
||
16 | { |
||
17 | public function creating(Comment $comment) |
||
18 | { |
||
19 | $comment->user_id = Auth::user()->id; |
||
|
|||
20 | |||
21 | if ($comment->commentable_type == 'issue') { |
||
22 | $tmp = app(Auth::user()->provider)->createOrUpdateIssueComment($comment); |
||
23 | $comment->provider_id = $tmp->id; |
||
24 | } |
||
25 | } |
||
26 | |||
27 | public function created(Comment $comment) |
||
31 | |||
32 | public function updated(Comment $comment) |
||
33 | { |
||
34 | if ($comment->commentable_type == 'issue') { |
||
35 | app(Auth::user()->provider)->createOrUpdateIssueComment($comment); |
||
36 | } |
||
37 | } |
||
38 | |||
39 | public function deleted(Comment $comment) |
||
48 | } |
||
49 |
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@property
annotation 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.