Test Failed
Push — master ( faf208...51c6fd )
by Martin
14:25
created

TaskController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A listAction() 0 10 1
1
<?php
2
3
namespace Todo\Web\ApiBundle\Controller;
4
5
use Todo\Application\Task\Query;
6
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
8
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
9
10
/**
11
 * Class TaskController
12
 *
13
 * @category None
14
 * @package  Web\ApiBundle\Controller
15
 * @author   Martin Pham <[email protected]>
16
 * @license  None http://
17
 * @link     None
18
 *
19
 * @Route("/task")
20
 */
21
class TaskController extends Controller
22
{
23
    /**
24
     * ListAction
25
     *
26
     * @param Query $taskQuery Task Query
27
     *
28
     * @Route("/list")
29
     * @Method({"GET"})
30
     *
31
     * @return \Symfony\Component\HttpFoundation\JsonResponse
32
     */
33
    public function listAction(
34
        Query $taskQuery
35
    ) {
36
        return $this->json(
37
            [
38
            'remaining_tasks' => $taskQuery->getAllRemainingTasks(),
39
            'completed_tasks' => $taskQuery->getAllCompletedTasks()
40
            ]
41
        );
42
    }
43
44
}
45