Passed
Pull Request — feature/eco-3047/dev (#35)
by Aleksey
09:26 queued 04:02
created

HeidelpayNotificationProcessor::__construct()   A

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\Yves\Heidelpay\Processor\Notification;
9
10
use Generated\Shared\Transfer\HeidelpayNotificationTransfer;
1 ignored issue
show
Bug introduced by
The type Generated\Shared\Transfe...payNotificationTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use SprykerEco\Client\Heidelpay\HeidelpayClientInterface;
12
use SprykerEco\Yves\Heidelpay\Processor\Notification\Mapper\HeidelpayNotificationProcessorMapperInterface;
13
use Symfony\Component\HttpFoundation\Request;
14
15
class HeidelpayNotificationProcessor implements HeidelpayNotificationProcessorInterface
16
{
17
    /**
18
     * @var \SprykerEco\Yves\Heidelpay\Processor\Notification\Mapper\HeidelpayNotificationProcessorMapperInterface
19
     */
20
    protected $mapper;
21
22
    /**
23
     * @var \SprykerEco\Client\Heidelpay\HeidelpayClientInterface
24
     */
25
    protected $client;
26
27
    /**
28
     * @param \SprykerEco\Yves\Heidelpay\Processor\Notification\Mapper\HeidelpayNotificationProcessorMapperInterface $mapper
29
     * @param \SprykerEco\Client\Heidelpay\HeidelpayClientInterface $client
30
     */
31
    public function __construct(
32
        HeidelpayNotificationProcessorMapperInterface $mapper,
33
        HeidelpayClientInterface $client
34
    ) {
35
        $this->mapper = $mapper;
36
        $this->client = $client;
37
    }
38
39
    /**
40
     * @param \Symfony\Component\HttpFoundation\Request $request
41
     *
42
     * @return \Generated\Shared\Transfer\HeidelpayNotificationTransfer
43
     */
44
    public function processNotification(Request $request): HeidelpayNotificationTransfer
45
    {
46
        $notificationTransfer = $this->mapper
47
            ->mapRequestToNotificationTransfer(
48
                $request,
49
                new HeidelpayNotificationTransfer()
50
            );
51
52
        return $this->client->processNotification($notificationTransfer);
53
    }
54
}
55