Total Complexity | 6 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 92.86% |
Changes | 0 |
1 | <?php |
||
14 | class WebhookFetcher implements WebhookFetcherInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var BotApiNormalizer |
||
18 | */ |
||
19 | private $normalizer; |
||
20 | |||
21 | /** |
||
22 | * WebhookFetcher constructor. |
||
23 | * |
||
24 | * @param NormalizerInterface $normalizer |
||
25 | */ |
||
26 | 3 | public function __construct(NormalizerInterface $normalizer) |
|
27 | { |
||
28 | 3 | $this->normalizer = $normalizer; |
|
|
|||
29 | 3 | } |
|
30 | |||
31 | /** |
||
32 | * @param RequestInterface|string $request |
||
33 | * |
||
34 | * @throws BadRequestException |
||
35 | * |
||
36 | * @return UpdateType |
||
37 | */ |
||
38 | 3 | public function fetch($request): UpdateType |
|
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param $request |
||
50 | * |
||
51 | * @throws BadRequestException |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | 3 | private function getContents($request): string |
|
64 | } |
||
65 | } |
||
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.