Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
38 | 3 | public function fetch($request): UpdateType |
|
39 | { |
||
40 | 3 | $input = \json_decode($this->getContents($request)); |
|
41 | 3 | if (!($input instanceof \stdClass)) { |
|
42 | 1 | throw new BadRequestException('Request content must be valid JSON object.'); |
|
43 | } |
||
44 | |||
45 | 2 | return $this->normalizer->denormalize($input, UpdateType::class); |
|
46 | } |
||
66 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.