| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | public function sendTextMessage(Request $request) |
||
| 52 | { |
||
| 53 | $this->validate($request, [ |
||
| 54 | 'telephone' => 'required' |
||
| 55 | ]); |
||
| 56 | |||
| 57 | $response = $this->client->sendMessage($this->message); |
||
| 58 | |||
| 59 | if ($response->getMessageId()) { |
||
| 60 | return redirect()->back()->with('info', trans('texts.message.sent_success')); |
||
| 61 | } |
||
| 62 | |||
| 63 | return redirect()->back()->with('errors', trans('texts.message.sent_failed')); |
||
| 64 | } |
||
| 65 | } |
||
| 66 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: