1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-18 23:26:20 +02:00

Bump phpstan to level 8

This commit is contained in:
Jordi Boggiano
2021-07-04 14:03:55 +02:00
parent 4ef5da80ad
commit 8b5278d8e1
47 changed files with 262 additions and 101 deletions

View File

@@ -27,6 +27,8 @@ use Monolog\Logger;
* @link https://core.telegram.org/bots/api
*
* @author Mazur Alexandr <alexandrmazur96@gmail.com>
*
* @phpstan-import-type Record from \Monolog\Logger
*/
class TelegramBotHandler extends AbstractProcessingHandler
{
@@ -127,6 +129,7 @@ class TelegramBotHandler extends AbstractProcessingHandler
*/
public function handleBatch(array $records): void
{
/** @var Record[] $messages */
$messages = [];
foreach ($records as $record) {
@@ -135,6 +138,7 @@ class TelegramBotHandler extends AbstractProcessingHandler
}
if ($this->processors) {
/** @var Record $record */
$record = $this->processRecord($record);
}
@@ -174,6 +178,9 @@ class TelegramBotHandler extends AbstractProcessingHandler
]));
$result = Curl\Util::execute($ch);
if (!is_string($result)) {
throw new RuntimeException('Telegram API error. Description: No response');
}
$result = json_decode($result, true);
if ($result['ok'] === false) {