| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 58 | private function logEvent($event, BaseModel $model) |
||
| 59 | { |
||
| 60 | $user = Auth::getUser(); |
||
| 61 | |||
| 62 | if (!is_null($user)) { |
||
| 63 | |||
| 64 | Log::create([ |
||
| 65 | 'action' => $event, |
||
| 66 | 'entity_id' => $model->id, |
||
|
|
|||
| 67 | 'entity_type' => get_class($model), |
||
| 68 | 'state' => $model->toJson(), |
||
| 69 | 'created_by' => $user->id, |
||
| 70 | ]); |
||
| 71 | |||
| 72 | } |
||
| 73 | } |
||
| 74 | } |
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.