Notify::after()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 11
Ratio 100 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
dl 11
loc 11
rs 9.4286
c 4
b 0
f 0
cc 2
eloc 5
nc 2
nop 3
1
<?php namespace Cerbero\Auth\Pipes\Recover;
2
3
use Cerbero\Auth\Pipes\AbstractPipe;
4
use Illuminate\Contracts\Mail\Mailer;
5
6
class Notify extends AbstractPipe {
7
8
	/**
9
	 * Run after the handled job.
10
	 *
11
	 * @param	Illuminate\Contracts\Mail\Mailer	$mailer
12
	 * @param	mixed	$handled
13
	 * @param	Cerbero\Auth\Jobs\RecoverJob	$job
14
	 * @return	mixed
15
	 */
16 View Code Duplication
	public function after(Mailer $mailer, $handled, $job)
17
	{
18
		$email = $job->email;
19
20
		$method = config('_auth.recover.email.queue') ? 'queue' : 'send';
21
22
		$mailer->$method(config('_auth.recover.email.view'), ['token' => $handled], function($message) use($email)
23
		{
24
			$message->to($email)->subject(trans('auth::recover.email_subject'));
25
		});
26
	}
27
28
}
29