Skip to content

Commit 4fdde13

Browse files
committed
Cleanup
1 parent 33f8ade commit 4fdde13

6 files changed

Lines changed: 18 additions & 22 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ Want to add your own open-source project to this list? [Click here!](https://doc
398398
* <a href="https://docs.madelineproto.xyz/PHP/danog/MadelineProto/API.html#getpsrlogger-psr-log-loggerinterface" name="getPsrLogger">Get PSR logger: getPsrLogger</a>
399399
* <a href="https://docs.madelineproto.xyz/API_docs/methods/phone.getGroupCallStreamRtmpUrl.html" name="phone.getGroupCallStreamRtmpUrl">Get RTMP URL and stream key for RTMP livestreams. Can be used even before creating the actual RTMP livestream with phone.createGroupCall (the rtmp_stream flag must be set): phone.getGroupCallStreamRtmpUrl</a>
400400
* <a href="https://docs.madelineproto.xyz/PHP/danog/MadelineProto/API.html#getmethodnamespaces-array" name="getMethodNamespaces">Get TL namespaces: getMethodNamespaces</a>
401-
* <a href="https://docs.madelineproto.xyz/PHP/danog/MadelineProto/API.html#gettl-danog-madelineproto-tl-tl" name="getTL">Get TL serializer: getTL</a>
401+
* <a href="https://docs.madelineproto.xyz/PHP/danog/MadelineProto/API.html#gettl-danog-madelineproto-tl-tlinterface" name="getTL">Get TL serializer: getTL</a>
402402
* <a href="https://docs.madelineproto.xyz/API_docs/methods/help.getPremiumPromo.html" name="help.getPremiumPromo">Get Telegram Premium promotion information: help.getPremiumPromo</a>
403403
* <a href="https://docs.madelineproto.xyz/PHP/danog/MadelineProto/API.html#mbstrlen-string-text-int" name="mbStrlen">Get Telegram UTF-8 length of string: mbStrlen</a>
404404
* <a href="https://docs.madelineproto.xyz/API_docs/methods/stats.getBroadcastStats.html" name="stats.getBroadcastStats">Get channel statistics: stats.getBroadcastStats</a>

‎langs/fa.json‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"apiChoosePrompt": "انتخاب شما (m/a): ",
3-
"apiManualInstructions0": "ورود به https://my.telegram.org",
4-
"apiAppInstructionsManual0": "اسم برنامه شما، میتواند هرچیزی باشد",
5-
"apiAppInstructionsManual1": "اسم مخفف برنامه شما، 5 تا 32 کاراکتر الفبا اعداد",
6-
"apiAppInstructionsManual2": "لینک برنامه/وبسایت شما، یا t.me/yourusername",
3+
"apiManualInstructions0": "وارد حساب خود در https://my.telegram.org شوید",
4+
"apiAppInstructionsManual0": "اسم اپلیکیشن شما، می‌تواند هرچیزی باشد",
5+
"apiAppInstructionsManual1": "اسم کوتاه اپلیکیشن شما، 5 تا 32 کاراکتر، حروف و اعداد انگلیسی",
6+
"apiAppInstructionsManual2": "لینک اپلیکیشن/وبسایت شما، یا t.me/yourusername",
77
"apiAppInstructionsManual3": "هرچیزی",
8-
"apiAppInstructionsManual4": "برنامه‌تان را اینجا توصیف کنید",
8+
"apiAppInstructionsManual4": "اپلیکیشن خود را اینجا توصیف کنید",
99
"apiManualPrompt0": "API ID خود را وارد کنید: ",
1010
"apiManualPrompt1": "API Hash خود را وارد کنید: ",
1111
"apiAutoPrompt0": "شماره‌ای را وارد کنید که از قبل در تلگرام ثبت‌نام کرده باشد: ",
@@ -15,8 +15,8 @@
1515
"apiAppInstructionsAuto2": "لینک برنامه/وبسایت را وارد کنید، یا t.me/yourusername: ",
1616
"apiAppInstructionsAuto4": "برنامه‌تان را توصیف کنید: ",
1717
"apiAppInstructionsAutoTypeOther": "مابقی (در توضیحات مشخص کنید)",
18-
"apiChooseManualAutoTip": "به یاد داشته باشید که میتوانید به صورت مستقیم API ID و API Hash را داخل کدتان با استفاده از تنظیمات مقرر کنید. %s",
19-
"apiChooseManualAutoTipWeb": "به یاد داشته باشید که میتوانید به صورت مستقیم API ID و API Hash را داخل کدتان با استفاده از <a target=\"_blank\" href=\"%s\">تنظیمات</a>مقرر کنید.",
18+
"apiChooseManualAutoTip": "در نظر داشته باشید که می‌توانید API ID و API Hash را به طور مستقیم داخل کدتان با استفاده از تنظیمات وارد کنید. %s",
19+
"apiChooseManualAutoTipWeb": "در نظر باشید که می‌توانید API ID و API Hash را به صورت مستقیم داخل کدتان با استفاده از <a target=\"_blank\" href=\"%s\">تنظیمات</a> وارد کنید.",
2020
"go": "برو",
2121
"apiManualWeb": "API ID و API HASH خود را وارد کنید",
2222
"apiAutoWeb": "برای دریافت API ID شماره‌ای را وارد کنید که از قبل در تلگرام <b>ثبت‌نام</b> کرده باشد",
@@ -47,7 +47,7 @@
4747
"value_bigger_than_9223372036854775807": "مقدار داده شده‌ی %s بیشتر از 9223372036854775807 است",
4848
"already_loggedIn": "نمونه‌ی MadelineProto از قبل وارد شده!",
4949
"login_code_sent": "کد با موفقیت ارسال شد! زمانی که کد را دریافت کردید باید از تابع completePhoneLogin استفاده کنید.",
50-
"apiManualInstructions2": "روی (create application) کلیک کنید",
50+
"apiManualInstructions2": "روی create application کلیک کنید",
5151
"signupFirstName": "نام خود را وارد کنید: ",
5252
"signupLastName": "نام خانوادگی خود را وارد کنید (می‌تواند خالی باشد): ",
5353
"loginNoPass": "شما کلمه عبور را وارد نکردید!",

‎src/Loop/Connection/WriteLoop.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function unencryptedWriteLoop(): bool
9797
$message_id = $message->getMsgId() ?? $this->connection->msgIdHandler->generateMessageId();
9898
$length = \strlen($message->getSerializedBody());
9999
$pad_length = -$length & 15;
100-
$pad_length += 16 * Tools::randomInt($modulus = 16);
100+
$pad_length += 16 * Tools::randomInt(modulus: 16);
101101
$pad = Tools::random($pad_length);
102102
$buffer = $this->connection->stream->getWriteBuffer(8 + 8 + 4 + $pad_length + $length);
103103
$buffer->bufferWrite("\0\0\0\0\0\0\0\0".$message_id.Tools::packUnsignedInt($length).$message->getSerializedBody().$pad);

‎src/Settings/Connection.php‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
final class Connection extends SettingsAbstract
3030
{
3131
/**
32-
* RSA keys
32+
* RSA keys.
3333
*/
3434
protected array $rsaKeys = [
3535
"-----BEGIN RSA PUBLIC KEY-----\n".
@@ -42,7 +42,7 @@ final class Connection extends SettingsAbstract
4242
'-----END RSA PUBLIC KEY-----',
4343
];
4444
/**
45-
* Test RSA keys
45+
* Test RSA keys.
4646
*/
4747
protected array $testRsaKeys = [
4848
"-----BEGIN RSA PUBLIC KEY-----\n".
@@ -638,21 +638,19 @@ public function setBindTo(?string $bindTo): self
638638
}
639639

640640
/**
641-
* Get RSA keys
641+
* Get RSA keys.
642642
*
643-
* @return array
644643
*/
645644
public function getRsaKeys(): array
646645
{
647646
return $this->rsaKeys;
648647
}
649648

650649
/**
651-
* Set RSA keys
650+
* Set RSA keys.
652651
*
653652
* @param array $rsaKeys RSA keys
654653
*
655-
* @return self
656654
*/
657655
public function setRsaKeys(array $rsaKeys): self
658656
{
@@ -662,21 +660,19 @@ public function setRsaKeys(array $rsaKeys): self
662660
}
663661

664662
/**
665-
* Get test RSA keys
663+
* Get test RSA keys.
666664
*
667-
* @return array
668665
*/
669666
public function getTestRsaKeys(): array
670667
{
671668
return $this->testRsaKeys;
672669
}
673670

674671
/**
675-
* Set test RSA keys
672+
* Set test RSA keys.
676673
*
677674
* @param array $testRsaKeys Test RSA keys
678675
*
679-
* @return self
680676
*/
681677
public function setTestRsaKeys(array $testRsaKeys): self
682678
{

‎src/Stream/MTProtoTransport/IntermediatePaddedStream.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function disconnect(): void
6060
*/
6161
public function getWriteBuffer(int $length, string $append = ''): \danog\MadelineProto\Stream\WriteBufferInterface
6262
{
63-
$padding_length = Tools::randomInt($modulus = 16);
63+
$padding_length = Tools::randomInt(modulus: 16);
6464
$buffer = $this->stream->getWriteBuffer(4 + $length + $padding_length, $append.Tools::random($padding_length));
6565
$buffer->bufferWrite(\pack('V', $padding_length + $length));
6666
return $buffer;

‎src/TL/TL.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ private function serializeParams(array $tl, array|Button $arguments, string|int
700700
continue;
701701
}
702702
if ($current_argument['name'] === 'random_bytes') {
703-
$serialized .= $this->serializeObject(['type' => 'bytes'], Tools::random(15 + 4 * Tools::randomInt($modulus = 3)), 'random_bytes');
703+
$serialized .= $this->serializeObject(['type' => 'bytes'], Tools::random(15 + 4 * Tools::randomInt(modulus: 3)), 'random_bytes');
704704
continue;
705705
}
706706
if ($current_argument['name'] === 'data' && isset($tl['method']) && \in_array($tl['method'], ['messages.sendEncrypted', 'messages.sendEncryptedFile', 'messages.sendEncryptedService'], true) && isset($arguments['message'])) {

0 commit comments

Comments
 (0)