| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 12 | public function add($id) |
||
| 13 | { |
||
| 14 | $id_user = Auth::user()->id; |
||
| 15 | $project = Project::find($id); |
||
| 16 | $model = new Bookmark(); |
||
| 17 | $model -> title = $project ->title; |
||
|
|
|||
| 18 | $model -> user_id = $id_user; |
||
| 19 | $model -> project_id = $project -> id; |
||
| 20 | $model ->save(); |
||
| 21 | |||
| 22 | return redirect('/show/'.$id); |
||
| 23 | |||
| 24 | } |
||
| 25 | |||
| 33 |
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@propertyannotation 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.