Skip to content

Commit eb400cd

Browse files
committed
IUmprove build scenario and fix code style
1 parent f5707c2 commit eb400cd

8 files changed

+43
-13
lines changed

composer.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,23 @@
4646
"config": {
4747
"sort-packages": true
4848
},
49+
"scripts": {
50+
"test": [
51+
"vendor/bin/phpunit"
52+
],
53+
"coverage-text": [
54+
"vendor/bin/phpunit --coverage-text --colors=never"
55+
],
56+
"coverage-html": [
57+
"vendor/bin/phpunit --coverage-html public/coverage"
58+
],
59+
"phpcs": [
60+
"vendor/bin/phpcs --standard=phpcs.xml -spn --encoding=utf-8 src/ tests/ --report-width=150"
61+
],
62+
"phpcbf": [
63+
"vendor/bin/phpcbf --standard=phpcs.xml -spn --encoding=utf-8 src/ tests/ --report-width=150"
64+
]
65+
},
4966
"extra": {
5067
"laravel": {
5168
"providers": [

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpcs.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,11 @@
33
<rule ref="./vendor/longman/php-code-style/longish.phpcs.xml">
44

55
</rule>
6+
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
7+
<exclude-pattern>src/database/*</exclude-pattern>
8+
</rule>
9+
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
10+
<exclude-pattern>tests/*</exclude-pattern>
11+
</rule>
612

7-
</ruleset>
13+
</ruleset>

src/Laravel/PhpTelegramBotServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function boot()
4141
);
4242

4343
$this->publishes([
44-
__DIR__.'/../database/migrations/' => database_path('migrations')
44+
__DIR__ . '/../database/migrations/' => database_path('migrations')
4545
], 'migrations');
4646
}
4747

src/database/migrations/2018_04_18_193554_create_edited_message_table.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ public function up()
2020
$table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier');
2121
$table->dateTime('edit_date')->nullable()->comment('Date the message was edited in timestamp format');
2222
$table->text('text', 65535)->nullable()->comment('For text messages, the actual UTF-8 text of the message max message length 4096 char utf8');
23-
$table->text('entities',
24-
65535)->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text');
23+
$table->text(
24+
'entities',
25+
65535
26+
)->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text');
2527
$table->text('caption', 65535)->nullable()->comment('For message with caption, the actual UTF-8 text of the caption');
2628
$table->index(['chat_id', 'message_id'], 'chat_id_2');
2729
});

src/database/migrations/2018_04_18_193554_create_message_table.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ public function up()
2626
$table->bigInteger('reply_to_message')->unsigned()->nullable()->index('reply_to_message')->comment('Message that this message is reply to');
2727
$table->text('media_group_id', 65535)->nullable()->comment('The unique identifier of a media message group this message belongs to');
2828
$table->text('text', 65535)->nullable()->comment('For text messages, the actual UTF-8 text of the message max message length 4096 char utf8mb4');
29-
$table->text('entities',
30-
65535)->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text');
29+
$table->text(
30+
'entities',
31+
65535
32+
)->nullable()->comment('For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text');
3133
$table->text('audio', 65535)->nullable()->comment('Audio object. Message is an audio file, information about the file');
3234
$table->text('document', 65535)->nullable()->comment('Document object. Message is a general file, information about the file');
3335
$table->text('photo', 65535)->nullable()->comment('Array of PhotoSize objects. Message is a photo, available sizes of the photo');
@@ -39,8 +41,10 @@ public function up()
3941
$table->text('location', 65535)->nullable()->comment('Location object. Message is a shared location, information about the location');
4042
$table->text('venue', 65535)->nullable()->comment('Venue object. Message is a Venue, information about the Venue');
4143
$table->text('caption', 65535)->nullable()->comment('For message with caption, the actual UTF-8 text of the caption');
42-
$table->text('new_chat_members',
43-
65535)->nullable()->comment('List of unique user identifiers, new member(s) were added to the group, information about them (one of these members may be the bot itself)');
44+
$table->text(
45+
'new_chat_members',
46+
65535
47+
)->nullable()->comment('List of unique user identifiers, new member(s) were added to the group, information about them (one of these members may be the bot itself)');
4448
$table->bigInteger('left_chat_member')->nullable()->index('left_chat_member')->comment('Unique user identifier, a member was removed from the group, information about them (this member may be the bot itself)');
4549
$table->char('new_chat_title')->nullable()->comment('A chat title was changed to this value');
4650
$table->text('new_chat_photo', 65535)->nullable()->comment('Array of PhotoSize objects. A chat photo was change to this value');

src/database/migrations/2018_04_18_193555_add_foreign_keys_to_telegram_update_table.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ public function up()
1616
Schema::table('telegram_update', function (Blueprint $table) {
1717
$table->foreign('chat_id', 'telegram_update_ibfk_1')->references('chat_id')->on('message')->onUpdate('RESTRICT')->onDelete('RESTRICT');
1818
$table->foreign('inline_query_id', 'telegram_update_ibfk_2')->references('id')->on('inline_query')->onUpdate('RESTRICT')->onDelete('RESTRICT');
19-
$table->foreign('chosen_inline_result_id',
20-
'telegram_update_ibfk_3')->references('id')->on('chosen_inline_result')->onUpdate('RESTRICT')->onDelete('RESTRICT');
19+
$table->foreign(
20+
'chosen_inline_result_id',
21+
'telegram_update_ibfk_3'
22+
)->references('id')->on('chosen_inline_result')->onUpdate('RESTRICT')->onDelete('RESTRICT');
2123
$table->foreign('callback_query_id', 'telegram_update_ibfk_4')->references('id')->on('callback_query')->onUpdate('RESTRICT')->onDelete('RESTRICT');
2224
$table->foreign('edited_message_id', 'telegram_update_ibfk_5')->references('id')->on('edited_message')->onUpdate('RESTRICT')->onDelete('RESTRICT');
2325
});

tests/Bootstrap.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
*/
2525
if (! file_exists($root . '/vendor/autoload.php')) {
2626
throw new Exception(
27-
'Please run "php composer.phar install --dev" in root directory '
28-
. 'to setup unit test dependencies before running the tests'
27+
'Please run "php composer.phar install --dev" in root directory to setup unit test dependencies before running the tests'
2928
);
3029
}
3130

0 commit comments

Comments
 (0)