GuestSessionController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A postGuests() 0 10 1
1
<?php
2
3
namespace App\Guests\Controller;
4
5
use App\Controller\BaseController;
6
use App\Guests\Entity\GuestSession;
7
use Symfony\Component\HttpFoundation\JsonResponse;
8
use Symfony\Component\Routing\Annotation\Route;
9
10
class GuestSessionController extends BaseController
11
{
12
    /**
13
     * @Route("/api/guests", methods={"POST"});
14
     *
15
     * @throws \Exception
16
     *
17
     * @return JsonResponse
18
     */
19 1
    public function postGuests()
20
    {
21 1
        $newGuestSession = new GuestSession();
22
23 1
        $em = $this->getDoctrine()->getManager();
24 1
        $em->persist($newGuestSession);
25 1
        $em->flush();
26
27 1
        return $this->response($newGuestSession);
28
    }
29
}
30