1 | <?php |
||
34 | class VersionConstraintController extends Controller |
||
35 | { |
||
36 | /** |
||
37 | * Try to validate the version constraint. |
||
38 | * |
||
39 | * @param Request $request The request. |
||
40 | * |
||
41 | * @return JsonResponse |
||
42 | * |
||
43 | * @throws \RuntimeException For invalid user classes. |
||
44 | * |
||
45 | * @ApiDoc( |
||
46 | * section="misc", |
||
47 | * statusCodes = { |
||
48 | * 200 = "When everything worked out ok", |
||
49 | * 400 = "When the request payload was invalid." |
||
50 | * }, |
||
51 | * authentication = true, |
||
52 | * authenticationRoles = { |
||
53 | * "ROLE_NONE" |
||
54 | * } |
||
55 | * ) |
||
56 | * @ApiDescription( |
||
57 | * request={ |
||
58 | * "constraint" = { |
||
59 | * "description" = "The constraint to test.", |
||
60 | * "dataType" = "string", |
||
61 | * "required" = true |
||
62 | * } |
||
63 | * }, |
||
64 | * response={ |
||
65 | * "status" = { |
||
66 | * "dataType" = "choice", |
||
67 | * "description" = "OK or ERROR", |
||
68 | * "format" = "['OK', 'ERROR']", |
||
69 | * }, |
||
70 | * "error" = { |
||
71 | * "dataType" = "string", |
||
72 | * "description" = "The error message (if any).", |
||
73 | * } |
||
74 | * } |
||
75 | * ) |
||
76 | */ |
||
77 | public function checkVersionConstraintAction(Request $request) |
||
122 | } |
||
123 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.