Completed
Pull Request — master (#2)
by Tomáš
09:22
created

ForgotPasswordResetEmail::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SixtyEightPublishers\User\ForgotPassword\Mail;
6
7
use Nette;
8
use SixtyEightPublishers;
9
10 View Code Duplication
final class ForgotPasswordResetEmail implements IForgotPasswordResetEmail
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
	use Nette\SmartObject;
13
14
	const NAME = 'forgot_password_reset_email';
15
16
	/** @var \SixtyEightPublishers\User\Common\Mail\IMailSender  */
17
	private $mailSender;
18
19
	/**
20
	 * @param \SixtyEightPublishers\User\Common\Mail\IMailSender $mailSender
21
	 */
22
	public function __construct(SixtyEightPublishers\User\Common\Mail\IMailSender $mailSender)
23
	{
24
		$this->mailSender = $mailSender;
25
	}
26
27
	/******** interface \SixtyEightPublishers\User\ForgotPassword\Mail\IForgotPasswordResetEmail ********/
28
29
	/**
30
	 * {@inheritdoc}
31
	 */
32
	public function send(SixtyEightPublishers\User\ForgotPassword\DoctrineEntity\IPasswordRequest $request): void
33
	{
34
		$this->mailSender->send(
35
			self::NAME,
36
			[
37
				new SixtyEightPublishers\User\Common\Mail\Address($request->getUser()->getEmail()),
38
			],
39
			[
40
				'request' => $request,
41
			]
42
		);
43
	}
44
}
45