1 | <?php |
||
15 | class GenericHandler |
||
16 | { |
||
17 | /** |
||
18 | * The container instance. |
||
19 | * |
||
20 | * @var \Illuminate\Container\Container |
||
21 | */ |
||
22 | protected $app; |
||
23 | |||
24 | /** |
||
25 | * Create a new GenericHandler instance. |
||
26 | * |
||
27 | * @param \Illuminate\Contracts\Container\Container $app |
||
28 | */ |
||
29 | public function __construct(Container $app) |
||
33 | |||
34 | /** |
||
35 | * Register the listeners for the subscriber. |
||
36 | * |
||
37 | * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher |
||
38 | */ |
||
39 | public function subscribe(Dispatcher $dispatcher) |
||
45 | |||
46 | /** |
||
47 | * Listen to the authentication lockout event. |
||
48 | * |
||
49 | * @param \Illuminate\Auth\Events\Lockout $event |
||
50 | * |
||
51 | * @return void |
||
52 | */ |
||
53 | public function lockout(Lockout $event): void |
||
54 | { |
||
55 | if (config('cortex.auth.emails.throttle_lockout')) { |
||
56 | switch ($event->request->route('accessarea')) { |
||
57 | case 'managerarea': |
||
58 | $model = app('cortex.auth.manager'); |
||
59 | break; |
||
60 | case 'adminarea': |
||
61 | $model = app('cortex.auth.admin'); |
||
62 | break; |
||
63 | case 'frontarea': |
||
64 | case 'tenantarea': |
||
65 | default: |
||
66 | $model = app('cortex.auth.member'); |
||
67 | break; |
||
68 | } |
||
69 | |||
70 | $user = get_login_field($loginfield = $event->request->get('loginfield')) === 'email' |
||
71 | ? $model::where('email', $loginfield)->first() |
||
72 | : $model::where('username', $loginfield)->first(); |
||
73 | |||
74 | ! $user || $user->notify(new AuthenticationLockoutNotification($event->request->ip(), $event->request->server('HTTP_USER_AGENT'))); |
||
75 | } |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * Listen to the authentication login event. |
||
80 | * |
||
81 | * @param \Illuminate\Auth\Events\Login $event |
||
82 | * |
||
83 | * @return void |
||
84 | */ |
||
85 | public function login(Login $event): void |
||
89 | |||
90 | /** |
||
91 | * Listen to the register success event. |
||
92 | * |
||
93 | * @param \Illuminate\Auth\Events\Registered $event |
||
94 | * |
||
95 | * @return void |
||
96 | */ |
||
97 | public function registered(Registered $event): void |
||
101 | } |
||
102 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.