NotificationController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A indexAction() 0 7 1
A createAcceptedResponse() 0 3 1
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\Controller;
9
10
use Spryker\Yves\Kernel\Controller\AbstractController;
11
use Symfony\Component\HttpFoundation\Request;
12
use Symfony\Component\HttpFoundation\Response;
13
14
/**
15
 * @method \SprykerEco\Yves\Heidelpay\HeidelpayFactory getFactory()
16
 * @method \SprykerEco\Client\Heidelpay\HeidelpayClientInterface getClient()
17
 */
18
class NotificationController extends AbstractController
19
{
20
    /**
21
     * @param \Symfony\Component\HttpFoundation\Request $request
22
     *
23
     * @return \Symfony\Component\HttpFoundation\Response
24
     */
25
    public function indexAction(Request $request): Response
26
    {
27
        $this->getFactory()
28
            ->createHeidelpayNotificationProcessor()
29
            ->processNotification($request);
30
31
        return $this->createAcceptedResponse();
32
    }
33
34
    /**
35
     * @return \Symfony\Component\HttpFoundation\Response
36
     */
37
    protected function createAcceptedResponse(): Response
38
    {
39
        return new Response('', Response::HTTP_OK);
40
    }
41
}
42