HeidelpayNotificationProcessor::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Zed\Heidelpay\Business\Processor\Notification;
9
10
use Generated\Shared\Transfer\HeidelpayNotificationTransfer;
11
use SprykerEco\Zed\Heidelpay\Business\Processor\Notification\Expander\NotificationExpanderInterface;
12
use SprykerEco\Zed\Heidelpay\Business\Writer\HeidelpayWriterInterface;
13
14
class HeidelpayNotificationProcessor implements HeidelpayNotificationProcessorInterface
15
{
16
    /**
17
     * @var \SprykerEco\Zed\Heidelpay\Business\Processor\Notification\Expander\NotificationExpanderInterface
18
     */
19
    protected $notificationExpander;
20
21
    /**
22
     * @var \SprykerEco\Zed\Heidelpay\Business\Writer\HeidelpayWriterInterface
23
     */
24
    protected $writer;
25
26
    /**
27
     * @param \SprykerEco\Zed\Heidelpay\Business\Processor\Notification\Expander\NotificationExpanderInterface $notificationExpander
28
     * @param \SprykerEco\Zed\Heidelpay\Business\Writer\HeidelpayWriterInterface $writer
29
     */
30
    public function __construct(
31
        NotificationExpanderInterface $notificationExpander,
32
        HeidelpayWriterInterface $writer
33
    ) {
34
        $this->notificationExpander = $notificationExpander;
35
        $this->writer = $writer;
36
    }
37
38
    /**
39
     * @param \Generated\Shared\Transfer\HeidelpayNotificationTransfer $notificationTransfer
40
     *
41
     * @return \Generated\Shared\Transfer\HeidelpayNotificationTransfer
42
     */
43
    public function processNotification(HeidelpayNotificationTransfer $notificationTransfer): HeidelpayNotificationTransfer
44
    {
45
        $notificationTransfer = $this->notificationExpander->expandWithNotificationData($notificationTransfer);
46
        $this->writer->createNotificationEntity($notificationTransfer);
47
48
        return $notificationTransfer;
49
    }
50
}
51