Passed
Push — main ( 8c6c55...1af2d8 )
by Miaad
12:23 queued 14s
created
src/types/sticker.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -38,25 +38,25 @@  discard block
 block discarded – undo
38 38
     public int $height;
39 39
 
40 40
     /** True, if the sticker is animated */
41
-    public null|bool $is_animated = null;
41
+    public null | bool $is_animated = null;
42 42
 
43 43
     /** True, if the sticker is a video sticker */
44
-    public null|bool $is_video = null;
44
+    public null | bool $is_video = null;
45 45
 
46 46
     /** Optional. Sticker thumbnail in the .WEBP or .JPG format */
47
-    public null|photoSize $thumbnail = null;
47
+    public null | photoSize $thumbnail = null;
48 48
 
49 49
     /** Optional. Emoji associated with the sticker */
50
-    public null|string $emoji = null;
50
+    public null | string $emoji = null;
51 51
 
52 52
     /** Optional. Name of the sticker set to which the sticker belongs */
53
-    public null|string $set_name = null;
53
+    public null | string $set_name = null;
54 54
 
55 55
     /** Optional. Premium animation for the sticker, if the sticker is premium */
56
-    public null|file $premium_animation = null;
56
+    public null | file $premium_animation = null;
57 57
 
58 58
     /** Optional. For mask stickers, the position where the mask should be placed */
59
-    public null|maskPosition $mask_position = null;
59
+    public null | maskPosition $mask_position = null;
60 60
 
61 61
     /** Optional. For custom emoji stickers, unique identifier of the custom emoji */
62 62
     public string $custom_emoji_id;
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
     public bool $needs_repainting;
69 69
 
70 70
     /** Optional. File size in bytes */
71
-    public null|int $file_size = null;
71
+    public null | int $file_size = null;
72 72
 
73 73
 
74
-    public function __construct(stdClass|null $object = null) {
74
+    public function __construct(stdClass | null $object = null) {
75 75
         if ($object != null) {
76 76
             parent::__construct($object, self::subs);
77 77
         }
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
      *
93 93
      * @return bool|string string will be returned when destination doesn't set
94 94
      */
95
-    public function download(string|null $destination = null): bool|string {
96
-        return telegram::downloadFile($destination ?? 'unknown.png',$this->file_id);
95
+    public function download(string | null $destination = null): bool | string {
96
+        return telegram::downloadFile($destination ?? 'unknown.png', $this->file_id);
97 97
     }
98 98
 
99 99
     /**
Please login to merge, or discard this patch.
src/types/photoSize.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
     public int $height;
29 29
 
30 30
     /** Optional. File size in bytes */
31
-    public null|int $file_size = null;
31
+    public null | int $file_size = null;
32 32
 
33 33
 
34
-    public function __construct(stdClass|null $object = null) {
34
+    public function __construct(stdClass | null $object = null) {
35 35
         if ($object != null) {
36 36
             parent::__construct($object, self::subs);
37 37
         }
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
      *
53 53
      * @return bool|string string will be returned when destination doesn't set
54 54
      */
55
-    public function download(string|null $destination = null): bool|string {
56
-        return telegram::downloadFile($destination ?? 'unknown.jpg',$this->file_id);
55
+    public function download(string | null $destination = null): bool | string {
56
+        return telegram::downloadFile($destination ?? 'unknown.jpg', $this->file_id);
57 57
     }
58 58
 
59 59
     /**
Please login to merge, or discard this patch.
src/types/chatPhoto.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     public string $big_file_unique_id;
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
         }
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
      *
60 60
      * @return bool|string string will be returned when destination doesn't set
61 61
      */
62
-    public function download(string|null $destination = null,bool $big = true): bool|string {
63
-        return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.mp4',$big ? $this->big_file_id : $this->small_file_id);
62
+    public function download(string | null $destination = null, bool $big = true): bool | string {
63
+        return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.mp4', $big ? $this->big_file_id : $this->small_file_id);
64 64
     }
65 65
 
66 66
     /**
Please login to merge, or discard this patch.
src/types/animation.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -31,23 +31,23 @@  discard block
 block discarded – undo
31 31
     public int $duration;
32 32
 
33 33
     /** Optional. Animation thumbnail as defined by sender */
34
-    public null|photoSize $thumbnail = null;
34
+    public null | photoSize $thumbnail = null;
35 35
 
36 36
     /** Optional. Original animation filename as defined by sender */
37
-    public null|string $file_name = null;
37
+    public null | string $file_name = null;
38 38
 
39 39
     /** Optional. MIME type of the file as defined by sender */
40
-    public null|string $mime_type = null;
40
+    public null | string $mime_type = null;
41 41
 
42 42
     /**
43 43
      * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have
44 44
      * difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit
45 45
      * integer or double-precision float type are safe for storing this value.
46 46
      */
47
-    public null|int $file_size = null;
47
+    public null | int $file_size = null;
48 48
 
49 49
 
50
-    public function __construct(stdClass|null $object = null) {
50
+    public function __construct(stdClass | null $object = null) {
51 51
         if ($object != null) {
52 52
             parent::__construct($object, self::subs);
53 53
         }
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
      *
69 69
      * @return bool|string string will be returned when destination doesn't set
70 70
      */
71
-    public function download(string|null $destination = null): bool|string {
72
-        return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.gif',$this->file_id);
71
+    public function download(string | null $destination = null): bool | string {
72
+        return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.gif', $this->file_id);
73 73
     }
74 74
 
75 75
     /**
Please login to merge, or discard this patch.
src/types/chatMemberUpdated.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     public bool $via_chat_folder_invite_link;
45 45
 
46 46
 
47
-    public function __construct(stdClass|null $object = null) {
47
+    public function __construct(stdClass | null $object = null) {
48 48
         if ($object != null) {
49 49
             parent::__construct($object, self::subs);
50 50
         }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      *
74 74
      * @return bool
75 75
      */
76
-    public function isMe (): bool {
76
+    public function isMe(): bool {
77 77
         return $this->new_chat_member->user->id == settings::$bot_id;
78 78
     }
79 79
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      *
110 110
      * @return bool
111 111
      */
112
-    public function isLeaved (): bool {
112
+    public function isLeaved(): bool {
113 113
         return $this->new_chat_member->status === chatMemberStatus::LEFT;
114 114
     }
115 115
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      *
119 119
      * @return bool
120 120
      */
121
-    public function isKicked (): bool {
121
+    public function isKicked(): bool {
122 122
         return $this->new_chat_member->status === chatMemberStatus::KICKED;
123 123
     }
124 124
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      *
128 128
      * @return bool
129 129
      */
130
-    public function isOldAdmin (): bool {
130
+    public function isOldAdmin(): bool {
131 131
         return $this->old_chat_member->status === chatMemberStatus::ADMINISTRATOR;
132 132
     }
133 133
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      *
137 137
      * @return bool
138 138
      */
139
-    public function isNewAdmin (): bool {
139
+    public function isNewAdmin(): bool {
140 140
         return $this->new_chat_member->status === chatMemberStatus::ADMINISTRATOR;
141 141
     }
142 142
 }
Please login to merge, or discard this patch.
src/types/audio.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,29 +25,29 @@  discard block
 block discarded – undo
25 25
     public int $duration;
26 26
 
27 27
     /** Optional. Performer of the audio as defined by sender or by audio tags */
28
-    public null|string $performer = null;
28
+    public null | string $performer = null;
29 29
 
30 30
     /** Optional. Title of the audio as defined by sender or by audio tags */
31
-    public null|string $title = null;
31
+    public null | string $title = null;
32 32
 
33 33
     /** Optional. Original filename as defined by sender */
34
-    public null|string $file_name = null;
34
+    public null | string $file_name = null;
35 35
 
36 36
     /** Optional. MIME type of the file as defined by sender */
37
-    public null|string $mime_type = null;
37
+    public null | string $mime_type = null;
38 38
 
39 39
     /**
40 40
      * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have
41 41
      * difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit
42 42
      * integer or double-precision float type are safe for storing this value.
43 43
      */
44
-    public null|int $file_size = null;
44
+    public null | int $file_size = null;
45 45
 
46 46
     /** Optional. Thumbnail of the album cover to which the music file belongs */
47
-    public null|photoSize $thumbnail = null;
47
+    public null | photoSize $thumbnail = null;
48 48
 
49 49
 
50
-    public function __construct(stdClass|null $object = null) {
50
+    public function __construct(stdClass | null $object = null) {
51 51
         if ($object != null) {
52 52
             parent::__construct($object, self::subs);
53 53
         }
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
      *
69 69
      * @return bool|string string will be returned when destination doesn't set
70 70
      */
71
-    public function download(string|null $destination = null): bool|string {
72
-        return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.mp3',$this->file_id);
71
+    public function download(string | null $destination = null): bool | string {
72
+        return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.mp3', $this->file_id);
73 73
     }
74 74
 
75 75
     /**
Please login to merge, or discard this patch.
src/types/chatInviteLink.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,22 +31,22 @@  discard block
 block discarded – undo
31 31
     public bool $is_revoked;
32 32
 
33 33
     /** Optional. Invite link name */
34
-    public null|string $name = null;
34
+    public null | string $name = null;
35 35
 
36 36
     /** Optional. Point in time (Unix timestamp) when the link will expire or has been expired */
37
-    public null|int $expire_date = null;
37
+    public null | int $expire_date = null;
38 38
 
39 39
     /**
40 40
      * Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat
41 41
      * via this invite link; 1-99999
42 42
      */
43
-    public null|int $member_limit = null;
43
+    public null | int $member_limit = null;
44 44
 
45 45
     /** Optional. Number of pending join requests created using this link */
46
-    public null|int $pending_join_request_count = null;
46
+    public null | int $pending_join_request_count = null;
47 47
 
48 48
 
49
-    public function __construct(stdClass|null $object = null) {
49
+    public function __construct(stdClass | null $object = null) {
50 50
         if ($object != null) {
51 51
             parent::__construct($object, self::subs);
52 52
         }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      *
58 58
      * @return responseError|bool|self
59 59
      */
60
-    public function revoke(): self|responseError|bool {
60
+    public function revoke(): self | responseError | bool {
61 61
         return $this->is_revoked ?? telegram::revokeChatInviteLink($this->invite_link);
62 62
     }
63 63
 }
Please login to merge, or discard this patch.
src/types/story.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     /** Keep all properties which has sub properties */
12 12
     private const subs = [];
13 13
 
14
-    public function __construct(stdClass|null $object = null) {
14
+    public function __construct(stdClass | null $object = null) {
15 15
         if ($object != null) {
16 16
             parent::__construct($object, self::subs);
17 17
         }
Please login to merge, or discard this patch.
src/types/types.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     public function __toString(): string {
12 12
         $array = json_decode(json_encode($this), true);
13 13
 
14
-        $cleanArray = function ($array) use (&$cleanArray) {
14
+        $cleanArray = function($array) use (&$cleanArray) {
15 15
             return array_filter(array_map(fn($value) => is_array($value) ? $cleanArray($value) : $value, $array));
16 16
         };
17 17
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             }
41 41
             else {
42 42
                 $this->{$key} = $value;
43
-                if (ucfirst($key) === basename(get_class($this)) . '_id') {
43
+                if (ucfirst($key) === basename(get_class($this)).'_id') {
44 44
                     $this->{'id'} = $value;
45 45
                 }
46 46
             }
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     public function __call(string $name, array $arguments) {
51 51
         $name = strtolower($name);
52 52
         if (str_starts_with($name, 'set')) {
53
-            $name = substr($name,3);
53
+            $name = substr($name, 3);
54 54
             if (isset($arguments[0])) {
55 55
                 $this->{$name} = $arguments[0];
56 56
             }
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,23 +22,19 @@  discard block
 block discarded – undo
22 22
         foreach ($object as $key=>$value) {
23 23
             if (isset($subs[$key])) {
24 24
                 $this->{$key} = new ($subs[$key]) ($value);
25
-            }
26
-            elseif (is_array($value) && isset($subs['array'])) {
25
+            } elseif (is_array($value) && isset($subs['array'])) {
27 26
                 foreach ($value as $sub_key => $sub_value) {
28 27
                     if (is_array($sub_value) && isset($subs['array']['array'])) {
29 28
                         foreach ($sub_value as $sub2_value) {
30 29
                             $this->{$key}[$sub_key][] = new ($subs['array']['array'][$key]) ($sub2_value);
31 30
                         }
32
-                    }
33
-                    elseif (isset($subs['array'][$key])) {
31
+                    } elseif (isset($subs['array'][$key])) {
34 32
                         $this->{$key}[] = new ($subs['array'][$key]) ($sub_value);
35
-                    }
36
-                    else {
33
+                    } else {
37 34
                         $this->{$key}[] = $sub_value;
38 35
                     }
39 36
                 }
40
-            }
41
-            else {
37
+            } else {
42 38
                 $this->{$key} = $value;
43 39
                 if (ucfirst($key) === basename(get_class($this)) . '_id') {
44 40
                     $this->{'id'} = $value;
@@ -53,8 +49,7 @@  discard block
 block discarded – undo
53 49
             $name = substr($name,3);
54 50
             if (isset($arguments[0])) {
55 51
                 $this->{$name} = $arguments[0];
56
-            }
57
-            elseif (isset($arguments['value'])) {
52
+            } elseif (isset($arguments['value'])) {
58 53
                 $this->{$name} = $arguments['value'];
59 54
             }
60 55
         }
Please login to merge, or discard this patch.