| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public static function isFlooding(string $rule = 'xetaravel.flood.general'): bool |
||
| 17 | { |
||
| 18 | $class = get_called_class(); |
||
| 19 | $user = Auth::user(); |
||
| 20 | |||
| 21 | return $class::where('user_id', $user->id) |
||
|
|
|||
| 22 | ->where( |
||
| 23 | 'created_at', |
||
| 24 | '>=', |
||
| 25 | Carbon::now()->subSeconds(config($rule)) |
||
| 26 | ) |
||
| 27 | ->exists(); |
||
| 28 | } |
||
| 29 | } |
||
| 30 |
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: