| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function sendMessage(int $chatId, string $text): bool |
||
| 36 | { |
||
| 37 | $sendMessage = new SendMessage(); |
||
| 38 | $sendMessage->chat_id = $chatId; |
||
|
|
|||
| 39 | $sendMessage->text = $text; |
||
| 40 | |||
| 41 | try { |
||
| 42 | $this->client->performApiRequest($sendMessage); |
||
| 43 | |||
| 44 | return true; |
||
| 45 | } catch (ClientException $e) { |
||
| 46 | return false; |
||
| 47 | } |
||
| 48 | } |
||
| 49 | } |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.