FindAction   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 14
ccs 2
cts 2
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A findAction() 0 7 1
1
<?php
2
declare(strict_types = 1);
3
/**
4
 * /src/Rest/Traits/Actions/Anon/FindAction.php
5
 *
6
 * @author TLe, Tarmo Leppänen <[email protected]>
7
 */
8
9
namespace App\Rest\Traits\Actions\Anon;
10
11
use App\Rest\Traits\Methods\FindMethod;
12
use Symfony\Component\HttpFoundation\Request;
13
use Symfony\Component\HttpFoundation\Response;
14
use Symfony\Component\Routing\Annotation\Route;
15
use Throwable;
16
17
/**
18
 * Trait FindAction
19
 *
20
 * Trait to add 'findAction' for REST controllers for anonymous users.
21
 *
22
 * @see \App\Rest\Traits\Methods\FindMethod for detailed documents.
23
 *
24
 * @package App\Rest\Traits\Actions\Anon
25
 * @author TLe, Tarmo Leppänen <[email protected]>
26
 */
27
trait FindAction
28
{
29
    use FindMethod;
30
31
    /**
32
     * @throws Throwable
33
     */
34 2
    #[Route(
35
        path: '',
36
        methods: [Request::METHOD_GET],
37
    )]
38
    public function findAction(Request $request): Response
39
    {
40 2
        return $this->findMethod($request);
41
    }
42
}
43