These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php namespace App\Listeners\Users; |
||
2 | |||
3 | use Illuminate\Mail\Message; |
||
4 | |||
5 | class SendActivationLinkViaEmail |
||
6 | { |
||
7 | 2 | public function handle($event) // Don't type-hint: this listener can be triggered by different events. |
|
8 | { |
||
9 | /** @var \App\Models\User $user */ |
||
10 | 2 | $user = $event->user; |
|
11 | 2 | if (false === ($activation = app('sentinel.activations')->exists($user))) { |
|
12 | 1 | $activation = app('sentinel.activations')->create($event->user); |
|
13 | 1 | } |
|
14 | 2 | $token = $activation->code; |
|
15 | 2 | $view = config('cartalyst.sentinel.activations.view'); |
|
16 | 2 | app('mailer')->send($view, compact('user', 'token'), function (Message $m) use ($user, $token) { |
|
17 | 2 | $m->to($user->email)->subject($this->getActivationEmailSubject()); |
|
0 ignored issues
–
show
|
|||
18 | 2 | }); |
|
19 | 2 | } |
|
20 | |||
21 | /** |
||
22 | * Get the e-mail subject line to be used for the reset link email. |
||
23 | * |
||
24 | * @return string |
||
25 | */ |
||
26 | 2 | private function getActivationEmailSubject() |
|
27 | { |
||
28 | 2 | return trans('auth.activation_email_subject'); |
|
29 | } |
||
30 | } |
||
31 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.