| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function getCurrentPoints(Model $pointable) |
||
| 33 | { |
||
| 34 | $currentPoint = Transaction:: |
||
| 35 | where('pointable_id', $pointable->id) |
||
| 36 | ->where('pointable_type', $pointable->getMorphClass()) |
||
| 37 | ->orderBy('created_at', 'desc') |
||
| 38 | ->pluck('current')->first(); |
||
| 39 | |||
| 40 | if (!$currentPoint) { |
||
| 41 | $currentPoint = 0.0; |
||
| 42 | } |
||
| 43 | |||
| 44 | return $currentPoint; |
||
| 45 | } |
||
| 46 | |||
| 72 |
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.