IndexController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A indexAction() 0 6 1
A tableAction() 0 5 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\Zed\Braintree\Communication\Controller;
9
10
use Spryker\Zed\Kernel\Communication\Controller\AbstractController;
11
12
/**
13
 * @method \SprykerEco\Zed\Braintree\Communication\BraintreeCommunicationFactory getFactory()
14
 * @method \SprykerEco\Zed\Braintree\Persistence\BraintreeQueryContainerInterface getQueryContainer()
15
 * @method \SprykerEco\Zed\Braintree\Business\BraintreeFacadeInterface getFacade()
16
 * @method \SprykerEco\Zed\Braintree\Persistence\BraintreeRepositoryInterface getRepository()
17
 */
18
class IndexController extends AbstractController
19
{
20
    /**
21
     * @return array
22
     */
23
    public function indexAction()
24
    {
25
        $table = $this->getFactory()->createPaymentsTable();
26
27
        return [
28
            'payments' => $table->render(),
29
        ];
30
    }
31
32
    /**
33
     * @return \Symfony\Component\HttpFoundation\JsonResponse
34
     */
35
    public function tableAction()
36
    {
37
        $table = $this->getFactory()->createPaymentsTable();
38
39
        return $this->jsonResponse($table->fetchData());
40
    }
41
}
42