Completed
Push — master ( b5d02b...a1ff02 )
by
unknown
07:40 queued 03:20
created

TagController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 7 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: dangis
5
 * Date: 18.6.2
6
 * Time: 14.35
7
 */
8
9
namespace App\Controller;
10
11
12
use App\Entity\Document;
13
use App\Service\DataService;
14
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
15
use Symfony\Component\HttpFoundation\JsonResponse;
16
use Symfony\Component\HttpFoundation\Request;
17
18
class TagController extends Controller
19
{
20
    /**
21
     * @param Request $request
22
     * @param DataService $dataService
23
     * @return JsonResponse
24
     */
25
    public function index(Request $request, DataService $dataService)
26
    {
27
        $input = $request->request->get('category');
28
29
        $documents = $this->getDoctrine()->getManager()->getRepository(Document::class)->tagFiles($input, $this->getUser());
30
31
        return $dataService->processData($documents);
32
    }
33
}