1 | <?php namespace Distilleries\Expendable\Listeners; |
||
7 | class UserListener extends BaseListener |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * @var array[ |
||
12 | * 'user.login'=>[ |
||
13 | * 'action'=>'handleLogin', |
||
14 | * 'priority'=>0 |
||
15 | * ] |
||
16 | * ] |
||
17 | * |
||
18 | */ |
||
19 | protected $events = [ |
||
20 | 'user.login' => [ |
||
21 | 'action' => 'handleLogin', |
||
22 | 'priority' => 0, |
||
23 | ], |
||
24 | 'user.logout' => [ |
||
25 | 'action' => 'handleLogOut', |
||
26 | 'priority' => 0, |
||
27 | ], |
||
28 | 'user.security' => [ |
||
29 | 'action' => 'handleLockIncrement', |
||
30 | 'priority' => 0, |
||
31 | ] |
||
32 | ]; |
||
33 | |||
34 | 16 | public function handleLogin(LockableContract $model) |
|
61 | |||
62 | 16 | public function handleLogOut() |
|
70 | |||
71 | 4 | public function handleLockIncrement($email) |
|
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: