Passed
Push — master ( 2ab801...3e09d8 )
by Shahrad
10:07
created
src/lib/Entities/Venue.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@
 block discarded – undo
21 21
 class Venue extends Entity
22 22
 {
23 23
 
24
-	/**
25
-	 * {@inheritdoc}
26
-	 */
27
-	protected function subEntities(): array
28
-	{
29
-		return [
30
-			'location' => Location::class,
31
-		];
32
-	}
24
+    /**
25
+     * {@inheritdoc}
26
+     */
27
+    protected function subEntities(): array
28
+    {
29
+        return [
30
+            'location' => Location::class,
31
+        ];
32
+    }
33 33
 
34 34
 }
Please login to merge, or discard this patch.
src/lib/Entities/ChatJoinRequest.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@
 block discarded – undo
20 20
 class ChatJoinRequest extends Entity
21 21
 {
22 22
 
23
-	/**
24
-	 * {@inheritdoc}
25
-	 */
23
+    /**
24
+     * {@inheritdoc}
25
+     */
26 26
     protected function subEntities(): array
27 27
     {
28 28
         return [
Please login to merge, or discard this patch.
src/lib/Entities/Video.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@
 block discarded – undo
23 23
 class Video extends Entity
24 24
 {
25 25
 
26
-	/**
27
-	 * {@inheritdoc}
28
-	 */
29
-	protected function subEntities(): array
30
-	{
31
-		return [
32
-			'thumb' => PhotoSize::class,
33
-		];
34
-	}
26
+    /**
27
+     * {@inheritdoc}
28
+     */
29
+    protected function subEntities(): array
30
+    {
31
+        return [
32
+            'thumb' => PhotoSize::class,
33
+        ];
34
+    }
35 35
 
36 36
 }
Please login to merge, or discard this patch.
src/lib/Entities/ChatLocation.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@
 block discarded – undo
17 17
 class ChatLocation extends Entity
18 18
 {
19 19
 
20
-	/**
21
-	 * {@inheritdoc}
22
-	 */
23
-	protected function subEntities(): array
24
-	{
25
-		return [
26
-			'location' => Location::class,
27
-		];
28
-	}
20
+    /**
21
+     * {@inheritdoc}
22
+     */
23
+    protected function subEntities(): array
24
+    {
25
+        return [
26
+            'location' => Location::class,
27
+        ];
28
+    }
29 29
 
30 30
 }
Please login to merge, or discard this patch.
src/lib/Entities/VoiceChatParticipantsInvited.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@
 block discarded – undo
16 16
 class VoiceChatParticipantsInvited extends Entity
17 17
 {
18 18
 
19
-	/**
20
-	 * {@inheritdoc}
21
-	 */
22
-	protected function subEntities(): array
23
-	{
24
-		return [
25
-			'users' => [User::class],
26
-		];
27
-	}
19
+    /**
20
+     * {@inheritdoc}
21
+     */
22
+    protected function subEntities(): array
23
+    {
24
+        return [
25
+            'users' => [User::class],
26
+        ];
27
+    }
28 28
 
29 29
 }
Please login to merge, or discard this patch.
src/lib/Plugin.php 1 patch
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -14,106 +14,106 @@
 block discarded – undo
14 14
 class Plugin
15 15
 {
16 16
 
17
-	/**
18
-	 * The Update types
19
-	 *
20
-	 * @var array
21
-	 */
22
-	protected array $update_types = [
23
-		'Message',
24
-		'EditedMessage',
25
-		'ChannelPost',
26
-		'EditedChannelPost',
27
-		'InlineQuery',
28
-		'ChosenInlineResult',
29
-		'CallbackQuery',
30
-		'ShippingQuery',
31
-		'PreCheckoutQuery',
32
-	];
33
-
34
-	/**
35
-	 * @var WebhookHandler
36
-	 */
37
-	protected WebhookHandler $hook;
38
-
39
-	/**
40
-	 * @var \Generator
41
-	 */
42
-	protected \Generator $returns;
43
-
44
-	/**
45
-	 * @var bool
46
-	 */
47
-	protected bool $kill_on_yield = true;
48
-
49
-	/**
50
-	 * Check for the exit of the plugin.
51
-	 *
52
-	 * @param \Generator $return
53
-	 * @return void
54
-	 */
55
-	public function __checkExit(\Generator $return): void
56
-	{
57
-		if ($return->valid()) {
58
-			if ($return->current() !== null && $this->kill_on_yield === true) {
59
-				$this->kill();
60
-			}
61
-		}
62
-
63
-		if ($return->valid()) {
64
-			$return->next();
65
-			$this->__checkExit($return);
66
-		}
67
-	}
68
-
69
-	/**
70
-	 * Identify the update type. e.g. Message, EditedMessage, etc.
71
-	 *
72
-	 * @param Update $update
73
-	 * @return string|null
74
-	 */
75
-	public function __identify(Update $update): ?string
76
-	{
77
-		$type = $update->getUpdateType();
78
-
79
-		if ($type === null) {
80
-			return null;
81
-		}
82
-
83
-		return str_replace('_', '', ucwords($type, '_'));
84
-	}
85
-
86
-	/**
87
-	 * Execute the plugin.
88
-	 *
89
-	 * @param WebhookHandler $receiver
90
-	 * @param Update $update
91
-	 * @return void
92
-	 */
93
-	public function __execute(WebhookHandler $receiver, Update $update): void
94
-	{
95
-		$this->hook = $receiver;
96
-
97
-		if (method_exists($this, 'onReceivedUpdate')) {
98
-			$return = $this->onReceivedUpdate($update);
99
-			$this->__checkExit($return);
100
-		}
101
-
102
-		$type = $this->__identify($update);
103
-		if (method_exists($this, ($method = 'on' . $type)) && $type !== null) {
104
-			$return = $this->$method($update);
105
-			$this->__checkExit($return);
106
-		}
107
-	}
108
-
109
-	/**
110
-	 * Kill the plugin.
111
-	 *
112
-	 * @return void
113
-	 */
114
-	public function kill(): void
115
-	{
116
-		$this->hook->kill();
117
-	}
17
+    /**
18
+     * The Update types
19
+     *
20
+     * @var array
21
+     */
22
+    protected array $update_types = [
23
+        'Message',
24
+        'EditedMessage',
25
+        'ChannelPost',
26
+        'EditedChannelPost',
27
+        'InlineQuery',
28
+        'ChosenInlineResult',
29
+        'CallbackQuery',
30
+        'ShippingQuery',
31
+        'PreCheckoutQuery',
32
+    ];
33
+
34
+    /**
35
+     * @var WebhookHandler
36
+     */
37
+    protected WebhookHandler $hook;
38
+
39
+    /**
40
+     * @var \Generator
41
+     */
42
+    protected \Generator $returns;
43
+
44
+    /**
45
+     * @var bool
46
+     */
47
+    protected bool $kill_on_yield = true;
48
+
49
+    /**
50
+     * Check for the exit of the plugin.
51
+     *
52
+     * @param \Generator $return
53
+     * @return void
54
+     */
55
+    public function __checkExit(\Generator $return): void
56
+    {
57
+        if ($return->valid()) {
58
+            if ($return->current() !== null && $this->kill_on_yield === true) {
59
+                $this->kill();
60
+            }
61
+        }
62
+
63
+        if ($return->valid()) {
64
+            $return->next();
65
+            $this->__checkExit($return);
66
+        }
67
+    }
68
+
69
+    /**
70
+     * Identify the update type. e.g. Message, EditedMessage, etc.
71
+     *
72
+     * @param Update $update
73
+     * @return string|null
74
+     */
75
+    public function __identify(Update $update): ?string
76
+    {
77
+        $type = $update->getUpdateType();
78
+
79
+        if ($type === null) {
80
+            return null;
81
+        }
82
+
83
+        return str_replace('_', '', ucwords($type, '_'));
84
+    }
85
+
86
+    /**
87
+     * Execute the plugin.
88
+     *
89
+     * @param WebhookHandler $receiver
90
+     * @param Update $update
91
+     * @return void
92
+     */
93
+    public function __execute(WebhookHandler $receiver, Update $update): void
94
+    {
95
+        $this->hook = $receiver;
96
+
97
+        if (method_exists($this, 'onReceivedUpdate')) {
98
+            $return = $this->onReceivedUpdate($update);
99
+            $this->__checkExit($return);
100
+        }
101
+
102
+        $type = $this->__identify($update);
103
+        if (method_exists($this, ($method = 'on' . $type)) && $type !== null) {
104
+            $return = $this->$method($update);
105
+            $this->__checkExit($return);
106
+        }
107
+    }
108
+
109
+    /**
110
+     * Kill the plugin.
111
+     *
112
+     * @return void
113
+     */
114
+    public function kill(): void
115
+    {
116
+        $this->hook->kill();
117
+    }
118 118
 
119 119
 }
120 120
\ No newline at end of file
Please login to merge, or discard this patch.