Skip to content

Commit 0714601

Browse files
irazasyedgithub-actions[bot]
authored andcommitted
Fix styling
1 parent 73ca0db commit 0714601

File tree

9 files changed

+29
-29
lines changed

9 files changed

+29
-29
lines changed

src/Commands/Command.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,14 @@ private function makeRegexPattern(): array
202202

203203
private function relevantMessageSubString(): string
204204
{
205-
//Get all the bot_command offsets in the Update object
205+
// Get all the bot_command offsets in the Update object
206206
$commandOffsets = $this->allCommandOffsets();
207207

208208
if ($commandOffsets->isEmpty()) {
209209
return $this->getUpdate()->getMessage()->text ?? '';
210210
}
211211

212-
//Extract the current offset for this command and, if it exists, the offset of the NEXT bot_command entity
212+
// Extract the current offset for this command and, if it exists, the offset of the NEXT bot_command entity
213213
$splice = $commandOffsets->splice(
214214
$commandOffsets->search($this->entity['offset']),
215215
2

src/Laravel/config/telegram.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
*/
4141
'allowed_updates' => null,
4242
'commands' => [
43-
//Acme\Project\Commands\MyTelegramBot\BotCommand::class
43+
// Acme\Project\Commands\MyTelegramBot\BotCommand::class
4444
],
4545
],
4646

src/Objects/CallbackQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function relations(): array
3232

3333
public function objectType(): ?string
3434
{
35-
//TODO - Check if message and inline_message_id are exclusive to each other
35+
// TODO - Check if message and inline_message_id are exclusive to each other
3636
return $this->findType(['data', 'game_short_name']);
3737
}
3838
}

src/Traits/CommandsHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function useGetUpdates(): array
6565
$this->processCommand($update);
6666
}
6767

68-
//An update is considered confirmed as soon as getUpdates is called with an offset higher than it's update_id.
68+
// An update is considered confirmed as soon as getUpdates is called with an offset higher than it's update_id.
6969
if ($highestId !== -1) {
7070
$this->markUpdateAsRead($highestId);
7171
}

src/Traits/Http.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public function getClient(): TelegramClient
242242
*/
243243
protected function uploadFile(string $endpoint, array $params, string $inputFileField): TelegramResponse
244244
{
245-
//Check if the field in the $params array (that is being used to send the relative file), is a file id.
245+
// Check if the field in the $params array (that is being used to send the relative file), is a file id.
246246
if (! isset($params[$inputFileField])) {
247247
throw CouldNotUploadInputFile::missingParam($inputFileField);
248248
}
@@ -251,7 +251,7 @@ protected function uploadFile(string $endpoint, array $params, string $inputFile
251251
return $this->post($endpoint, $params);
252252
}
253253

254-
//Sending an actual file requires it to be sent using multipart/form-data
254+
// Sending an actual file requires it to be sent using multipart/form-data
255255
return $this->post($endpoint, $this->prepareMultipartParams($params, $inputFileField), true);
256256
}
257257

@@ -288,7 +288,7 @@ protected function prepareMultipartParams(array $params, string $inputFileField)
288288
{
289289
$this->validateInputFileField($params, $inputFileField);
290290

291-
//Iterate through all param options and convert to multipart/form-data.
291+
// Iterate through all param options and convert to multipart/form-data.
292292
return collect($params)
293293
->reject(static fn ($value): bool => $value === null)
294294
->map(fn ($contents, $name) => $this->generateMultipartData($contents, $name))

tests/Integration/Api.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function createIncomeWebhookRequestInstance(array $updateData): Request
8888
/** @var Request $request */
8989
$request = $this->getHistory()->pluck('request')->first();
9090

91-
expect($request->getBody())->toEqual('') //'The get request had a body when it should be blank.'
91+
expect($request->getBody())->toEqual('') // 'The get request had a body when it should be blank.'
9292
->and($request->getUri()->getScheme())->toEqual('https')
9393
->and($request->getUri()->getHost())->toEqual('api.telegram.org')
9494
->and($request->getUri()->getPath())->toEqual('/botSpecial_Bot_Token/getChatMember')
@@ -211,7 +211,7 @@ function createIncomeWebhookRequestInstance(array $updateData): Request
211211
->throws(TelegramSDKException::class);
212212

213213
it('throws an exception if the param key used to upload file does not match the method being used', function () {
214-
//We want to send a document but the params have a voice key instead.
214+
// We want to send a document but the params have a voice key instead.
215215
$this->api->sendDocument([
216216
'chat_id' => 123456789,
217217
'voice' => InputFile::create(fopen('php://input', 'rb'), 'Myvoice.ogg'),
@@ -248,7 +248,7 @@ function createIncomeWebhookRequestInstance(array $updateData): Request
248248
$data = [];
249249
$api = api($this->getGuzzleHttpClient([$this->makeFakeInboundUpdate($data)]));
250250

251-
//We can use any file input here, for testing a stream is quick and easy.
251+
// We can use any file input here, for testing a stream is quick and easy.
252252
$api->sendDocument([
253253
'chat_id' => 123456789,
254254
'document' => InputFile::create(streamFor('Some text'), 'testing.txt'),
@@ -265,8 +265,8 @@ function createIncomeWebhookRequestInstance(array $updateData): Request
265265
});
266266

267267
it('can set a webhook with its own certificate successfully', function () {
268-
//Probably not the best way to attempt to create a file on a server.
269-
//Help appreciated.
268+
// Probably not the best way to attempt to create a file on a server.
269+
// Help appreciated.
270270
$fakeFile = fopen('php://temp', 'wb+');
271271
fwrite($fakeFile, pubKey());
272272
fseek($fakeFile, 0);
@@ -284,7 +284,7 @@ function createIncomeWebhookRequestInstance(array $updateData): Request
284284
'certificate' => InputFile::create(streamFor(pubKey()), 'public.key'),
285285
]);
286286

287-
//If the user uses just a string to the path/filename of the webhook cert.
287+
// If the user uses just a string to the path/filename of the webhook cert.
288288
$api->setWebhook([
289289
'url' => 'https://example.com',
290290
'certificate' => $fakeFile,

tests/Integration/BotsManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
->toHaveKey('bot1');
5151
});
5252

53-
//test('duplicated commands dont cause a problem', function () {
53+
// test('duplicated commands dont cause a problem', function () {
5454
// $manager = new BotsManager(
5555
// [
5656
// 'commands' => [
@@ -125,4 +125,4 @@
125125
// ->and($commands03)->toHaveCount(5)
126126
// ->and($commands04)->toHaveCount(7)
127127
// ->and($commands05)->toHaveCount(8);
128-
//})->skip('This test is not working properly');
128+
// })->skip('This test is not working properly');

tests/Unit/Commands/Command.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
});
1414

1515
test('a command with no pattern set will return an empty argument array', function () {
16-
//Condensed update data
16+
// Condensed update data
1717
$update = new Update([
1818
'message' => [
1919
'text' => 'This /demo',
@@ -36,7 +36,7 @@
3636
});
3737

3838
test('a command with no pattern set but has text after the command will return an empty argument array', function () {
39-
//Condensed update data
39+
// Condensed update data
4040
$update = new Update([
4141
'message' => [
4242
'text' => '/demo@testing_Bot John Doe',
@@ -59,7 +59,7 @@
5959
});
6060

6161
test('a command with only required pattern variables is parsed correctly', function () {
62-
//Condensed update data
62+
// Condensed update data
6363
$update = new Update([
6464
'message' => [
6565
'text' => '/demo@testing_Bot John Doe 77 200',
@@ -81,7 +81,7 @@
8181
});
8282

8383
test('a command with required and optional pattern variables is parsed correctly', function () {
84-
//Condensed update data
84+
// Condensed update data
8585
$update = new Update([
8686
'message' => [
8787
'text' => '/demo@testing_Bot John Doe 77 200',
@@ -103,7 +103,7 @@
103103
});
104104

105105
test('a command with more required pattern variables than exists in update message is not matched', function () {
106-
//Condensed update data
106+
// Condensed update data
107107
$update = new Update([
108108
'message' => [
109109
'text' => '/demo@testing_Bot John Doe 77',
@@ -130,7 +130,7 @@
130130
});
131131

132132
test('a command with custom regex set as pattern will return an array with the match value', function () {
133-
//Condensed update data
133+
// Condensed update data
134134
$update = new Update([
135135
'message' => [
136136
'text' => '/demo@testing_Bot eidw einn egaa egcc',
@@ -152,7 +152,7 @@
152152
});
153153

154154
test('a command with more advance custom regex set as pattern will return an array with the match value', function () {
155-
//Condensed update data
155+
// Condensed update data
156156
$update = new Update([
157157
'message' => [
158158
'text' => '/demo@testing_Bot ei105 22/03/2017',
@@ -174,7 +174,7 @@
174174
});
175175

176176
it('checks the arguments can be detected in a message with multiple commands that are the same', function () {
177-
//Condensed update data
177+
// Condensed update data
178178
$update = new Update([
179179
'message' => [
180180
'text' => 'This /demo john doe command with /demo jane doe and a unrelated /test command',
@@ -200,17 +200,17 @@
200200

201201
$this->command->setPattern('{fname} {lname}');
202202

203-
//First time the command is triggered for entity "0"
203+
// First time the command is triggered for entity "0"
204204
$entity0 = $update->getMessage()->entities->get(0)->toArray();
205205
$this->command->make($this->api, $update, $entity0);
206206
expect($this->command->getArguments())->toEqual(['fname' => 'john', 'lname' => 'doe']);
207207

208-
//Second time the command is triggered for entity "1"
208+
// Second time the command is triggered for entity "1"
209209
$entity1 = $update->getMessage()->entities->get(1)->toArray();
210210
$this->command->make($this->api, $update, $entity1);
211211
expect($this->command->getArguments())->toEqual(['fname' => 'jane', 'lname' => 'doe']);
212212

213-
//This command should not be triggered for entity "2". But if it is, the arguments should be blank.
213+
// This command should not be triggered for entity "2". But if it is, the arguments should be blank.
214214
$entity2 = $update->getMessage()->entities->get(2)->toArray();
215215
$this->command->make($this->api, $update, $entity2);
216216
expect($this->command->getArguments())->toEqual([

tests/Unit/Commands/CommandBus.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
expect($result)->toHaveCount(4);
7878
$this->assertStringContainsString('MockCommand3', $commandNames);
7979

80-
//Remove Specific command.
80+
// Remove Specific command.
8181
$this->bus->removeCommand('MockCommand3');
8282

8383
$newResult = $this->bus->getCommands();
@@ -98,7 +98,7 @@
9898
$this->assertStringContainsString('MockCommand1', $commandNames);
9999
$this->assertStringContainsString('MockCommand4', $commandNames);
100100

101-
//Remove multiple commands at once
101+
// Remove multiple commands at once
102102
$this->bus->removeCommands(['MockCommand1', 'MockCommand4']);
103103

104104
$newResult = $this->bus->getCommands();

0 commit comments

Comments
 (0)