Passed
Push — main ( 1a254f...723093 )
by Miaad
01:39
created
src/types/encryptedPassportElement.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
      * “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and
29 29
      * “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.
30 30
      */
31
-    public null|string $data = null;
31
+    public null | string $data = null;
32 32
 
33 33
     /** Optional. User's verified phone number, available only for “phone_number” type */
34
-    public null|string $phone_number = null;
34
+    public null | string $phone_number = null;
35 35
 
36 36
     /** Optional. User's verified email address, available only for “email” type */
37
-    public null|string $email = null;
37
+    public null | string $email = null;
38 38
 
39 39
     /**
40 40
      * Optional. Array of encrypted files with documents provided by the user, available for “utility_bill”,
@@ -42,28 +42,28 @@  discard block
 block discarded – undo
42 42
      * types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
43 43
      * @var passportFile[]
44 44
      */
45
-    public null|array $files = null;
45
+    public null | array $files = null;
46 46
 
47 47
     /**
48 48
      * Optional. Encrypted file with the front side of the document, provided by the user. Available for
49 49
      * “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be
50 50
      * decrypted and verified using the accompanying EncryptedCredentials.
51 51
      */
52
-    public null|passportFile $front_side = null;
52
+    public null | passportFile $front_side = null;
53 53
 
54 54
     /**
55 55
      * Optional. Encrypted file with the reverse side of the document, provided by the user. Available for
56 56
      * “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying
57 57
      * EncryptedCredentials.
58 58
      */
59
-    public null|passportFile $reverse_side = null;
59
+    public null | passportFile $reverse_side = null;
60 60
 
61 61
     /**
62 62
      * Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for
63 63
      * “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be
64 64
      * decrypted and verified using the accompanying EncryptedCredentials.
65 65
      */
66
-    public null|passportFile $selfie = null;
66
+    public null | passportFile $selfie = null;
67 67
 
68 68
     /**
69 69
      * Optional. Array of encrypted files with translated versions of documents provided by the user. Available if
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
      * EncryptedCredentials.
74 74
      * @var passportFile[]
75 75
      */
76
-    public null|array $translation = null;
76
+    public null | array $translation = null;
77 77
 
78 78
     /** Base64-encoded element hash for using in PassportElementErrorUnspecified */
79 79
     public string $hash;
80 80
 
81 81
 
82
-    public function __construct(stdClass|null $object = null) {
82
+    public function __construct(stdClass | null $object = null) {
83 83
         if ($object != null) {
84 84
             parent::__construct($object, self::subs);
85 85
         }
Please login to merge, or discard this patch.
src/types/preCheckoutQuery.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,13 +31,13 @@
 block discarded – undo
31 31
     public string $invoice_payload;
32 32
 
33 33
     /** Optional. Identifier of the shipping option chosen by the user */
34
-    public null|string $shipping_option_id = null;
34
+    public null | string $shipping_option_id = null;
35 35
 
36 36
     /** Optional. Order information provided by the user */
37
-    public null|orderInfo $order_info = null;
37
+    public null | orderInfo $order_info = null;
38 38
 
39 39
 
40
-    public function __construct(stdClass|null $object = null) {
40
+    public function __construct(stdClass | null $object = null) {
41 41
         if ($object != null) {
42 42
             parent::__construct($object, self::subs);
43 43
         }
Please login to merge, or discard this patch.
src/types/inlineQuery.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@
 block discarded – undo
30 30
      * should be always known for requests sent from official clients and most third-party clients, unless the
31 31
      * request was sent from a secret chat
32 32
      */
33
-    public null|string $chat_type = null;
33
+    public null | string $chat_type = null;
34 34
 
35 35
     /** Optional. Sender location, only for bots that request user location */
36
-    public null|location $location = null;
36
+    public null | location $location = null;
37 37
 
38 38
 
39
-    public function __construct(stdClass|null $object = null) {
39
+    public function __construct(stdClass | null $object = null) {
40 40
         if ($object != null) {
41 41
             parent::__construct($object, self::subs);
42 42
         }
Please login to merge, or discard this patch.
src/types/stickerSet.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@  discard block
 block discarded – undo
21 21
     public string $sticker_type;
22 22
 
23 23
     /** True, if the sticker set contains animated stickers */
24
-    public null|bool $is_animated = null;
24
+    public null | bool $is_animated = null;
25 25
 
26 26
     /** True, if the sticker set contains video stickers */
27
-    public null|bool $is_video = null;
27
+    public null | bool $is_video = null;
28 28
 
29 29
     /** Deprecated use sticker_type instead, True, if the sticker set contains masks */
30
-    public null|bool $contains_masks = null;
30
+    public null | bool $contains_masks = null;
31 31
 
32 32
     /**
33 33
      * List of all set stickers
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
     public array $stickers;
37 37
 
38 38
     /** Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format */
39
-    public null|photoSize $thumb = null;
39
+    public null | photoSize $thumb = null;
40 40
 
41 41
 
42
-    public function __construct(stdClass|null $object = null) {
42
+    public function __construct(stdClass | null $object = null) {
43 43
         if ($object != null) {
44 44
             parent::__construct($object, self::subs);
45 45
         }
Please login to merge, or discard this patch.
src/types/responseParameters.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@
 block discarded – undo
17 17
      * But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for
18 18
      * storing this identifier.
19 19
      */
20
-    public null|int $migrate_to_chat_id = null;
20
+    public null | int $migrate_to_chat_id = null;
21 21
 
22 22
     /**
23 23
      * Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be
24 24
      * repeated
25 25
      */
26
-    public null|int $retry_after = null;
26
+    public null | int $retry_after = null;
27 27
 
28 28
 
29
-    public function __construct(stdClass|null $object = null) {
29
+    public function __construct(stdClass | null $object = null) {
30 30
         if ($object != null) {
31 31
             parent::__construct($object, self::subs);
32 32
         }
Please login to merge, or discard this patch.
src/types/sentWebAppMessage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@
 block discarded – undo
15 15
      * Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the
16 16
      * message.
17 17
      */
18
-    public null|string $inline_message_id = null;
18
+    public null | string $inline_message_id = null;
19 19
 
20 20
 
21
-    public function __construct(stdClass|null $object = null) {
21
+    public function __construct(stdClass | null $object = null) {
22 22
         if ($object != null) {
23 23
             parent::__construct($object, self::subs);
24 24
         }
Please login to merge, or discard this patch.
src/types/poll.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -29,43 +29,43 @@
 block discarded – undo
29 29
     public int $total_voter_count;
30 30
 
31 31
     /** True, if the poll is closed */
32
-    public null|bool $is_closed = null;
32
+    public null | bool $is_closed = null;
33 33
 
34 34
     /** True, if the poll is anonymous */
35
-    public null|bool $is_anonymous = null;
35
+    public null | bool $is_anonymous = null;
36 36
 
37 37
     /** Poll type, currently can be “regular” or “quiz” */
38 38
     public string $type;
39 39
 
40 40
     /** True, if the poll allows multiple answers */
41
-    public null|bool $allows_multiple_answers = null;
41
+    public null | bool $allows_multiple_answers = null;
42 42
 
43 43
     /**
44 44
      * Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which
45 45
      * are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
46 46
      */
47
-    public null|int $correct_option_id = null;
47
+    public null | int $correct_option_id = null;
48 48
 
49 49
     /**
50 50
      * Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style
51 51
      * poll, 0-200 characters
52 52
      */
53
-    public null|string $explanation = null;
53
+    public null | string $explanation = null;
54 54
 
55 55
     /**
56 56
      * Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
57 57
      * @var messageEntity[]
58 58
      */
59
-    public null|array $explanation_entities = null;
59
+    public null | array $explanation_entities = null;
60 60
 
61 61
     /** Optional. Amount of time in seconds the poll will be active after creation */
62
-    public null|int $open_period = null;
62
+    public null | int $open_period = null;
63 63
 
64 64
     /** Optional. Point in time (Unix timestamp) when the poll will be automatically closed */
65
-    public null|int $close_date = null;
65
+    public null | int $close_date = null;
66 66
 
67 67
 
68
-    public function __construct(stdClass|null $object = null) {
68
+    public function __construct(stdClass | null $object = null) {
69 69
         if ($object != null) {
70 70
             parent::__construct($object, self::subs);
71 71
         }
Please login to merge, or discard this patch.
src/types/chatMemberUpdated.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,10 +36,10 @@
 block discarded – undo
36 36
      * Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events
37 37
      * only.
38 38
      */
39
-    public null|chatInviteLink $invite_link = null;
39
+    public null | chatInviteLink $invite_link = null;
40 40
 
41 41
 
42
-    public function __construct(stdClass|null $object = null) {
42
+    public function __construct(stdClass | null $object = null) {
43 43
         if ($object != null) {
44 44
             parent::__construct($object, self::subs);
45 45
         }
Please login to merge, or discard this patch.
src/telegram/request/answer.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,44 +17,44 @@
 block discarded – undo
17 17
     /**
18 18
      * @internal Only for BPT self usage , Don't use it in your source!
19 19
      */
20
-    public static function init(string $method,array $data): bool {
20
+    public static function init(string $method, array $data): bool {
21 21
         self::checkAnswered();
22 22
         self::checkWebhook();
23 23
         self::sieveData($data);
24 24
         self::$is_answered = true;
25 25
         $data['method'] = $method;
26 26
         $payload = json_encode($data);
27
-        header('Content-Type: application/json;Content-Length: ' . strlen($payload));
27
+        header('Content-Type: application/json;Content-Length: '.strlen($payload));
28 28
         echo $payload;
29 29
         return true;
30 30
     }
31 31
 
32 32
     private static function checkAnswered(): void {
33 33
         if (self::$is_answered) {
34
-            logger::write('You can use answer mode only once for each webhook update , You already did it!',loggerTypes::ERROR);
34
+            logger::write('You can use answer mode only once for each webhook update , You already did it!', loggerTypes::ERROR);
35 35
             throw new bptException('ANSWER_MODE_USED');
36 36
         }
37 37
     }
38 38
 
39 39
     private static function checkWebhook(): void {
40
-        if(settings::$receiver === receiver::GETUPDATES) {
41
-            logger::write('Answer mode only work when receiver is webhook',loggerTypes::ERROR);
40
+        if (settings::$receiver === receiver::GETUPDATES) {
41
+            logger::write('Answer mode only work when receiver is webhook', loggerTypes::ERROR);
42 42
             throw new bptException('ANSWER_MODE_GETUPDATES');
43 43
         }
44
-        elseif(settings::$multi) {
45
-            logger::write('You can not use answer mode when multi setting is on',loggerTypes::ERROR);
44
+        elseif (settings::$multi) {
45
+            logger::write('You can not use answer mode when multi setting is on', loggerTypes::ERROR);
46 46
             throw new bptException('ANSWER_MODE_MULTI');
47 47
         }
48 48
     }
49 49
 
50 50
     private static function sieveData(array &$data): void {
51
-        unset($data['token'],$data['forgot'],$data['return_array']);
51
+        unset($data['token'], $data['forgot'], $data['return_array']);
52 52
 
53
-        foreach ($data as $key=>&$value){
54
-            if (!isset($value)){
53
+        foreach ($data as $key=>&$value) {
54
+            if (!isset($value)) {
55 55
                 unset($data[$key]);
56 56
             }
57
-            elseif (is_array($value) || is_object($value)){
57
+            elseif (is_array($value) || is_object($value)) {
58 58
                 $value = json_encode($value);
59 59
             }
60 60
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,8 +34,7 @@  discard block
 block discarded – undo
34 34
         if(settings::$receiver === receiver::GETUPDATES) {
35 35
             logger::write('Answer mode only work when receiver is webhook',loggerTypes::ERROR);
36 36
             throw new bptException('ANSWER_MODE_GETUPDATES');
37
-        }
38
-        elseif(settings::$multi) {
37
+        } elseif(settings::$multi) {
39 38
             logger::write('You can not use answer mode when multi setting is on',loggerTypes::ERROR);
40 39
             throw new bptException('ANSWER_MODE_MULTI');
41 40
         }
@@ -49,8 +48,7 @@  discard block
 block discarded – undo
49 48
         foreach ($data as $key=>&$value){
50 49
             if (!isset($value)){
51 50
                 unset($data[$key]);
52
-            }
53
-            elseif (is_array($value) || is_object($value)){
51
+            } elseif (is_array($value) || is_object($value)){
54 52
                 $value = json_encode($value);
55 53
             }
56 54
         }
Please login to merge, or discard this patch.