Completed
Push — npm-shrinkwrap ( 52ca24 )
by Kamil
23:13
created

PaymentMethodController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 5
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPaymentGatewaysAction() 0 15 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\CoreBundle\Controller;
13
14
use FOS\RestBundle\View\View;
15
use Sylius\Bundle\ResourceBundle\Controller\ResourceController;
16
use Symfony\Component\HttpFoundation\Request;
17
use Symfony\Component\HttpFoundation\Response;
18
19
/**
20
 * @author Mateusz Zalewski <[email protected]>
21
 */
22
class PaymentMethodController extends ResourceController
23
{
24
    /**
25
     * @param Request $request
26
     * @param string $template
27
     *
28
     * @return Response
29
     */
30
    public function getPaymentGatewaysAction(Request $request, $template)
31
    {
32
        $configuration = $this->requestConfigurationFactory->create($this->metadata, $request);
33
34
        $view = View::create()
35
            ->setTemplate($template)
36
            ->setTemplateVar($this->metadata->getPluralName())
37
            ->setData([
38
                'gatewayFactories' => $this->getParameter('sylius.gateway_factories'),
39
                'metadata' => $this->metadata,
40
            ])
41
        ;
42
43
        return $this->viewHandler->handle($configuration, $view);
44
    }
45
}
46