ApiController::wsAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Seblegall\ApiValidatorBundle\Tests\Fixtures\Bundles\ExampleBundle\Controller;
4
5
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6
use Symfony\Component\HttpFoundation\JsonResponse;
7
use Symfony\Component\HttpFoundation\Request;
8
use Seblegall\ApiValidatorBundle\Annotations\ApiParameters;
9
10
class ApiController extends Controller
11
{
12
    public function wsAction(Request $request)
13
    {
14
        $apiParameters = $request->attributes->get('api_parameters');
15
16
        return new JsonResponse($apiParameters->all());
17
    }
18
19
    /**
20
     * @ApiParameters(bag="Seblegall\ApiValidatorBundle\Tests\Fixtures\Bundles\ExampleBundle\Api\ExampleApiParameterBag")
21
     *
22
     * @param Request $request
23
     *
24
     * @return JsonResponse
25
     */
26
    public function ws2Action(Request $request)
27
    {
28
        $apiParameters = $request->attributes->get('api_parameters');
29
30
        return new JsonResponse($apiParameters->all());
31
    }
32
33
    /**
34
     * @ApiParameters(bag="Seblegall\ApiValidatorBundle\Tests\Fixtures\Bundles\ExampleBundle\Api\ExampleApiParameterBag", validation=true)
35
     *
36
     * @param Request $request
37
     *
38
     * @return JsonResponse
39
     */
40
    public function ws3Action(Request $request)
41
    {
42
        $apiParameters = $request->attributes->get('api_parameters');
43
44
        return new JsonResponse($apiParameters->all());
45
    }
46
47
    /**
48
     * @ApiParameters(bag="Seblegall\ApiValidatorBundle\Tests\Fixtures\Bundles\ExampleBundle\Api\ExampleApiParameterBag", as="apiParam")
49
     *
50
     * @param Request $request
51
     *
52
     * @return JsonResponse
53
     */
54
    public function ws4Action(Request $request, $apiParam)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
55
    {
56
        return new JsonResponse($apiParam->all());
57
    }
58
59
    /**
60
     * @param Request $request
61
     *
62
     * @return JsonResponse
63
     */
64
    public function ws5Action(Request $request, $apiParam)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
65
    {
66
        return new JsonResponse($apiParam->all());
67
    }
68
69
    /**
70
     * @param Request $request
71
     *
72
     * @return JsonResponse
73
     */
74
    public function subCollectionAction(Request $request, $apiParam)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
75
    {
76
        return new JsonResponse($apiParam->all());
77
    }
78
}
79