UserController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 21
ccs 2
cts 2
cp 1
rs 10
1
<?php
2
3
namespace App\Controller;
4
5
use App\Entity\User;
6
use FOS\RestBundle\Controller\Annotations as Rest;
7
use FOS\RestBundle\Request\ParamFetcher;
8
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
9
use Nelmio\ApiDocBundle\Annotation\Model;
10
use Swagger\Annotations as SWG;
11
use Symfony\Component\HttpFoundation\JsonResponse;
12
use Symfony\Component\HttpFoundation\Response;
13
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
14
15
class UserController extends Controller
16
{
17
    /**
18
     * @Rest\Get("/api/users", methods={"GET"})
19
     * @Rest\View
20
     * @SWG\Response(
21
     *     response=200,
22
     *     description="Returns a list of users",
23
     *     @SWG\Schema(
24
     *         type="array",
25
     *         @Model(type=App\Entity\User::class)
26
     *     )
27
     * )
28
     * @SWG\Tag(name="User Service")
29
     */
30 2
    public function index()
31
    {
32 2
        return $this->getDoctrine()->getRepository(User::class)->findAll();
33
    }
34
35
}
36