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

ListResponder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 29
ccs 0
cts 6
cp 0
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
     * @param ActionConfiguration $configuration
14
     * @param AdminInterface      $admin
15
     * @param FormInterface       $form
16
     * @param FormInterface       $filterForm
17
     *
18
     * @return Response
19
     *
20
     */
21
    public function respond(
22
        ActionConfiguration $configuration,
23
        AdminInterface $admin,
24
        FormInterface $form,
25
        FormInterface $filterForm = null
26
    ) {
27
        $context = [
28
            'admin' => $admin,
29
            'form' => $form->createView(),
30
        ];
31
    
32
        if (null !== $filterForm) {
33
            $context['filterForm'] = $filterForm->createView();
34
        }
35
    
36
        return $this->render($configuration->getParameter('template'), $context);
37
    }
38
}
39