Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | function sendMessageToUser() |
||
|
|||
23 | { |
||
24 | $this->validate($this->request,[ |
||
25 | 'user_id'=>'required', |
||
26 | 'message' => 'required' |
||
27 | ]); |
||
28 | |||
29 | $user_id = $this->request->user_id; |
||
30 | $data = ['message'=>$this->request->message,'event'=>'receivedMessage']; |
||
31 | |||
32 | $this->sendToUser($user_id,$data); |
||
33 | } |
||
34 | |||
48 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.