Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
25 | 20 | public function handleRequest(FormInterface $form, $request = null) |
|
26 | { |
||
27 | 20 | if (!$request instanceof Request) { |
|
28 | 2 | throw new UnexpectedTypeException($request, Symfony\Component\HttpFoundation\Request::class); |
|
29 | } |
||
30 | |||
31 | 18 | if ($request->getContentType() !== 'json') { |
|
32 | 4 | $this->httpFoundationRequestHandler->handleRequest($form, $request); |
|
33 | |||
34 | 4 | return; |
|
35 | } |
||
36 | |||
37 | 14 | $form->submit($request->getContent()); |
|
|
|||
38 | 6 | } |
|
39 | } |
||
40 |
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.