Completed
Pull Request — master (#90)
by Arnaud
02:11
created

ListResponder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 30
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A respond() 0 17 2
1
<?php
2
3
namespace LAG\AdminBundle\Action\Responder;
4
5
use LAG\AdminBundle\Action\Configuration\ActionConfiguration;
6
use LAG\AdminBundle\Admin\AdminInterface;
7
use Symfony\Component\Form\FormInterface;
8
use Symfony\Component\HttpFoundation\Response;
9
10
class ListResponder extends AbstractResponder
11
{
12
    /**
13
     * Display the template "list" with an optional filter form.
14
     *
15
     * @param ActionConfiguration $configuration
16
     * @param AdminInterface      $admin
17
     * @param FormInterface       $form
18
     * @param FormInterface       $filterForm
19
     *
20
     * @return Response
21 1
     */
22
    public function respond(
23
        ActionConfiguration $configuration,
24
        AdminInterface $admin,
25
        FormInterface $form,
26
        FormInterface $filterForm = null
27
    ) {
28 1
        $context = [
29 1
            'admin' => $admin->getView(),
30
            'form' => $form->createView(),
31
        ];
32 1
    
33 1
        if (null !== $filterForm) {
34
            $context['filterForm'] = $filterForm->createView();
35
        }
36 1
    
37
        return $this->render($configuration->getParameter('template'), $context);
38
    }
39
}
40