Passed
Push — develop ( c95ce3...d0c957 )
by BENARD
22:42 queued 19:38
created

ReadAllForum::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ProjetNormandie\ForumBundle\Controller;
6
7
use ProjetNormandie\ForumBundle\Service\MarkAsReadService;
8
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
9
use Symfony\Component\HttpFoundation\JsonResponse;
10
11
class ReadAllForum extends AbstractController
12
{
13
    private MarkAsReadService $markAsReadService;
14
15
    public function __construct(MarkAsReadService $markAsReadService)
16
    {
17
        $this->markAsReadService = $markAsReadService;
18
    }
19
20
    /**
21
     * @return JsonResponse
22
     */
23
    public function __invoke(): JsonResponse
24
    {
25
        $this->markAsReadService->readAll();
26
        return new JsonResponse(['sucess' => true]);
27
    }
28
}
29