Completed
Push — template-events ( d018fc...2e9f01 )
by Kamil
65:59 queued 42:59
created

OrderEmailManager   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A sendConfirmationEmail() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Bundle\ShopBundle\EmailManager;
13
14
use Sylius\Bundle\CoreBundle\Mailer\Emails;
15
use Sylius\Component\Core\Model\OrderInterface;
16
use Sylius\Component\Mailer\Sender\SenderInterface;
17
18
/**
19
 * @author Hussein Jafferjee <[email protected]>
20
 */
21
final class OrderEmailManager implements OrderEmailManagerInterface
22
{
23
    /**
24
     * @var SenderInterface
25
     */
26
    private $emailSender;
27
28
    /**
29
     * @param SenderInterface $emailSender
30
     */
31
    public function __construct(SenderInterface $emailSender)
32
    {
33
        $this->emailSender = $emailSender;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function sendConfirmationEmail(OrderInterface $order)
40
    {
41
        $this->emailSender->send(Emails::ORDER_CONFIRMATION, [$order->getCustomer()->getEmail()], ['order' => $order]);
42
    }
43
}
44