Conditions | 3 |
Paths | 3 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function validate(Request $request): ?RequestProblemExceptionInterface { |
||
18 | $requestContentType = $this->getRequestContentType($request); |
||
19 | if ($requestContentType !== 'application/xml') { |
||
20 | return null; |
||
21 | } |
||
22 | |||
23 | $requestBody = $request->getContent(); |
||
24 | $violations = $this->validateAgainstSchema($requestBody); |
||
|
|||
25 | if (count($violations) > 0) { |
||
26 | $exception = new InvalidRequestBodyProblemException( |
||
27 | ProblemException::DEFAULT_TYPE_URI, |
||
28 | 'The request body contains errors.', |
||
29 | Response::HTTP_BAD_REQUEST, |
||
30 | 'Validation of XML request body failed.' |
||
31 | ); |
||
32 | |||
33 | return $exception->withViolations($violations); |
||
34 | } |
||
35 | |||
36 | return null; |
||
37 | } |
||
46 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.