1 | <?php |
||
23 | trait ShouldNotifyTrait |
||
24 | { |
||
25 | protected $body = null; |
||
26 | protected $topic_id = null; |
||
27 | protected $reply_id = 0; |
||
28 | protected $user_id = null; |
||
29 | protected $from_user_id = null; |
||
30 | protected $type = null; |
||
31 | |||
32 | public function getReplyId() |
||
36 | |||
37 | public function __call($method, $args) |
||
46 | |||
47 | /** |
||
48 | * 设置 Notification Type. |
||
49 | * |
||
50 | * @param $type |
||
51 | */ |
||
52 | public function setNotificationType($type) |
||
56 | |||
57 | /** |
||
58 | * 从 Topic 对象初始化通知信息. |
||
59 | * |
||
60 | * @param Topic $topic |
||
61 | * @param $from_user_id |
||
62 | */ |
||
63 | public function setNotificationInfoFromTopic(Topic $topic, $from_user_id) |
||
74 | |||
75 | /** |
||
76 | * 从 Reply 对象初始化通知信息. |
||
77 | * |
||
78 | * @param Reply $reply |
||
79 | * @param $from_user_id |
||
80 | * @param null $user_id |
||
81 | */ |
||
82 | public function setNotificationInfoFromReply(Reply $reply, $from_user_id, $user_id = null) |
||
94 | } |
||
95 |
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.