Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function authorize(): bool |
||
19 | { |
||
20 | parent::authorize(); |
||
21 | |||
22 | $user = $this->user($this->route('guard')) |
||
23 | ?? $this->attemptUser($this->route('guard')) |
||
|
|||
24 | ?? app('cortex.auth.member')->whereNotNull('phone')->where('phone', $this->get('phone'))->first(); |
||
25 | |||
26 | if (! $user) { |
||
27 | // User instance required to detect active TwoFactor methods |
||
28 | throw new GenericException(trans('cortex/foundation::messages.session_required'), route('frontarea.login')); |
||
29 | } |
||
30 | |||
31 | return true; |
||
32 | } |
||
33 | |||
46 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: