From 5eddc101dc2d0822ec9f62c35ae9befd19f2534b Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 20 May 2017 13:46:46 +0000 Subject: [PATCH] Apply fixes from StyleCI --- bots/pipesbot.php | 6 +++--- src/danog/MadelineProto/TL/Conversion/BotAPI.php | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bots/pipesbot.php b/bots/pipesbot.php index 2c3e0a48..fa278c80 100755 --- a/bots/pipesbot.php +++ b/bots/pipesbot.php @@ -109,7 +109,7 @@ while (true) { foreach ($updates as $update) { $offset = $update['update_id'] + 1; // Just like in the bot API, the offset must be set to the last update_id try { - switch ($update['update']['_']) { + switch ($update['update']['_']) { case 'updateNewMessage': if (isset($update['update']['message']['out']) && $update['update']['message']['out']) { continue; @@ -218,8 +218,8 @@ while (true) { } } } - } catch (\danog\MadelineProto\RPCErrorException $e) {} - + } catch (\danog\MadelineProto\RPCErrorException $e) { + } } \danog\MadelineProto\Serialization::serialize('pipesbot.madeline', $MadelineProto); \danog\MadelineProto\Serialization::serialize('pwr.madeline', $uMadelineProto); diff --git a/src/danog/MadelineProto/TL/Conversion/BotAPI.php b/src/danog/MadelineProto/TL/Conversion/BotAPI.php index 3da9ca38..f883e526 100644 --- a/src/danog/MadelineProto/TL/Conversion/BotAPI.php +++ b/src/danog/MadelineProto/TL/Conversion/BotAPI.php @@ -470,8 +470,12 @@ trait BotAPI $text_arr = []; foreach ($this->multipleExplodeKeepDelimiters(["\n"], $text) as $word) { if (strlen($word) > 4096) { - foreach (str_split($word, 4096) as $vv) { $text_arr []= $vv; } - } else $text_arr []= $word; + foreach (str_split($word, 4096) as $vv) { + $text_arr[] = $vv; + } + } else { + $text_arr[] = $word; + } } $i = 0; $message[0] = ''; @@ -501,7 +505,7 @@ trait BotAPI $finalArray = []; foreach ($initialArray as $item) { if (strlen($item) > 0) { - $finalArray []= $item.$string[strpos($string, $item)+strlen($item)]; + $finalArray[] = $item.$string[strpos($string, $item) + strlen($item)]; } }