| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 58 | public function store(Thread $thread) |
||
| 59 | { |
||
| 60 | request()->merge(['user_id' => Auth::user()->id]); |
||
| 61 | |||
| 62 | request()->validate([ |
||
| 63 | 'body' => 'required', |
||
| 64 | 'user_id' => 'required', |
||
| 65 | ]); |
||
| 66 | |||
| 67 | $thread->addMessage(request('body'), Auth::user()->id); |
||
| 68 | |||
| 69 | return redirect($thread->path()); |
||
| 70 | } |
||
| 71 | } |
||
| 72 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read 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.