Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.0625 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php namespace Distilleries\Expendable\Listeners; |
||
71 | 4 | public function handleLockIncrement($email) |
|
72 | { |
||
73 | 4 | $model = app('Distilleries\Expendable\Contracts\LockableContract'); |
|
74 | 4 | $user = $model->where('email', $email)->get()->last(); |
|
75 | |||
76 | 4 | if (!empty($user)) |
|
77 | 4 | { |
|
78 | $user->incrementLock(); |
||
79 | } |
||
80 | 4 | } |
|
81 | } |
||
82 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: