Skip to content

Commit fa66d9f

Browse files
committed
Reformat the project
1 parent a0fadde commit fa66d9f

31 files changed

+103
-294
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "php-telegram-bot/laravel",
33
"type": "library",
4-
"description": "Package to integrate PHP Telegram Bot library in Laravel 5.x",
4+
"description": "Package to integrate PHP Telegram Bot library in Laravel 6.x",
55
"keywords": [
66
"laravel",
77
"telegram",
@@ -22,9 +22,9 @@
2222
}
2323
],
2424
"require": {
25-
"php": ">=5.5.9",
26-
"illuminate/database": "5.*|6.*",
27-
"illuminate/support": "5.*|6.*",
25+
"php": "^7.2",
26+
"illuminate/database": "^6.0",
27+
"illuminate/support": "^6.0",
2828
"longman/telegram-bot": "^0.60"
2929
},
3030
"require-dev": {

phpcs.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@
1010
<exclude-pattern>tests/*</exclude-pattern>
1111
</rule>
1212

13+
<!-- Temp fix -->
14+
<rule ref="PSR12.Files.FileHeader">
15+
<exclude name="PSR12.Files.FileHeader.IncorrectOrder"/>
16+
</rule>
17+
1318
</ruleset>

src/Laravel/PhpTelegramBot.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
/*
36
* This file is part of the PhpTelegramBot/Laravel package.
47
*
@@ -7,12 +10,11 @@
710
* For the full copyright and license information, please view the LICENSE
811
* file that was distributed with this source code.
912
*/
10-
1113
namespace PhpTelegramBot\Laravel;
1214

1315
use Longman\TelegramBot\Telegram;
1416

1517
class PhpTelegramBot extends Telegram implements PhpTelegramBotContract
1618
{
17-
19+
//
1820
}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
/*
36
* This file is part of the PhpTelegramBot/Laravel package.
47
*
@@ -7,13 +10,12 @@
710
* For the full copyright and license information, please view the LICENSE
811
* file that was distributed with this source code.
912
*/
10-
1113
namespace PhpTelegramBot\Laravel;
1214

1315
/**
1416
* @mixin \Longman\TelegramBot\Telegram
1517
*/
1618
interface PhpTelegramBotContract
1719
{
18-
20+
//
1921
}

src/Laravel/PhpTelegramBotServiceProvider.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
/*
36
* This file is part of the PhpTelegramBot/Laravel package.
47
*
@@ -7,7 +10,6 @@
710
* For the full copyright and license information, please view the LICENSE
811
* file that was distributed with this source code.
912
*/
10-
1113
namespace PhpTelegramBot\Laravel;
1214

1315
use Illuminate\Contracts\Foundation\Application;
@@ -41,7 +43,7 @@ public function boot()
4143
);
4244

4345
$this->publishes([
44-
__DIR__ . '/../database/migrations/' => database_path('migrations')
46+
__DIR__ . '/../database/migrations/' => database_path('migrations'),
4547
], 'migrations');
4648
}
4749

@@ -52,7 +54,7 @@ public function boot()
5254
*/
5355
public function register()
5456
{
55-
$this->app->bind(PhpTelegramBotContract::class, function (Application $app) {
57+
$this->app->bind(PhpTelegramBotContract::class, static function (Application $app) {
5658
$config = $app['config']->get('phptelegrambot');
5759

5860
$bot = new PhpTelegramBot($config['bot']['api_key'], ! empty($config['bot']['name']) ? $config['bot']['name'] : '');

src/config/config.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
return [
46
/**
57
* Bot configuration
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
46
use Illuminate\Database\Schema\Blueprint;
57

68
class CreateBotanShortenerTable extends Migration
79
{
8-
9-
/**
10-
* Run the migrations.
11-
*
12-
* @return void
13-
*/
1410
public function up()
1511
{
16-
Schema::create('botan_shortener', function (Blueprint $table) {
12+
Schema::create('botan_shortener', static function (Blueprint $table) {
1713
$table->bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry');
1814
$table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier');
1915
$table->text('url', 65535)->comment('Original URL');
@@ -22,14 +18,8 @@ public function up()
2218
});
2319
}
2420

25-
/**
26-
* Reverse the migrations.
27-
*
28-
* @return void
29-
*/
3021
public function down()
3122
{
3223
Schema::drop('botan_shortener');
3324
}
34-
3525
}
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
46
use Illuminate\Database\Schema\Blueprint;
57

68
class CreateCallbackQueryTable extends Migration
79
{
8-
9-
/**
10-
* Run the migrations.
11-
*
12-
* @return void
13-
*/
1410
public function up()
1511
{
16-
Schema::create('callback_query', function (Blueprint $table) {
12+
Schema::create('callback_query', static function (Blueprint $table) {
1713
$table->bigInteger('id')->unsigned()->primary()->comment('Unique identifier for this query');
1814
$table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier');
1915
$table->bigInteger('chat_id')->nullable()->index('chat_id')->comment('Unique chat identifier');
@@ -25,14 +21,8 @@ public function up()
2521
});
2622
}
2723

28-
/**
29-
* Reverse the migrations.
30-
*
31-
* @return void
32-
*/
3324
public function down()
3425
{
3526
Schema::drop('callback_query');
3627
}
37-
3828
}
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
46
use Illuminate\Database\Schema\Blueprint;
57

68
class CreateChatTable extends Migration
79
{
8-
9-
/**
10-
* Run the migrations.
11-
*
12-
* @return void
13-
*/
1410
public function up()
1511
{
16-
Schema::create('chat', function (Blueprint $table) {
12+
Schema::create('chat', static function (Blueprint $table) {
1713
$table->bigInteger('id')->primary()->comment('Unique user or chat identifier');
1814
$table->enum('type', ['private', 'group', 'supergroup', 'channel'])->comment('Chat type, either private, group, supergroup or channel');
1915
$table->char('title')->nullable()->default('')->comment('Chat (group) title, is null if chat type is private');
@@ -24,14 +20,8 @@ public function up()
2420
});
2521
}
2622

27-
/**
28-
* Reverse the migrations.
29-
*
30-
* @return void
31-
*/
3223
public function down()
3324
{
3425
Schema::drop('chat');
3526
}
36-
3727
}
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
46
use Illuminate\Database\Schema\Blueprint;
57

68
class CreateChosenInlineResultTable extends Migration
79
{
8-
9-
/**
10-
* Run the migrations.
11-
*
12-
* @return void
13-
*/
1410
public function up()
1511
{
16-
Schema::create('chosen_inline_result', function (Blueprint $table) {
12+
Schema::create('chosen_inline_result', static function (Blueprint $table) {
1713
$table->bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry');
1814
$table->char('result_id')->default('')->comment('Identifier for this result');
1915
$table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier');
@@ -24,14 +20,8 @@ public function up()
2420
});
2521
}
2622

27-
/**
28-
* Reverse the migrations.
29-
*
30-
* @return void
31-
*/
3223
public function down()
3324
{
3425
Schema::drop('chosen_inline_result');
3526
}
36-
3727
}
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
46
use Illuminate\Database\Schema\Blueprint;
57

68
class CreateConversationTable extends Migration
79
{
8-
9-
/**
10-
* Run the migrations.
11-
*
12-
* @return void
13-
*/
1410
public function up()
1511
{
16-
Schema::create('conversation', function (Blueprint $table) {
12+
Schema::create('conversation', static function (Blueprint $table) {
1713
$table->bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry');
1814
$table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier');
1915
$table->bigInteger('chat_id')->nullable()->index('chat_id')->comment('Unique user or chat identifier');
@@ -24,14 +20,8 @@ public function up()
2420
});
2521
}
2622

27-
/**
28-
* Reverse the migrations.
29-
*
30-
* @return void
31-
*/
3223
public function down()
3324
{
3425
Schema::drop('conversation');
3526
}
36-
3727
}
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
46
use Illuminate\Database\Schema\Blueprint;
57

68
class CreateEditedMessageTable extends Migration
79
{
8-
9-
/**
10-
* Run the migrations.
11-
*
12-
* @return void
13-
*/
1410
public function up()
1511
{
16-
Schema::create('edited_message', function (Blueprint $table) {
12+
Schema::create('edited_message', static function (Blueprint $table) {
1713
$table->bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry');
1814
$table->bigInteger('chat_id')->nullable()->index('chat_id')->comment('Unique chat identifier');
1915
$table->bigInteger('message_id')->unsigned()->nullable()->index('message_id')->comment('Unique message identifier');
@@ -29,14 +25,8 @@ public function up()
2925
});
3026
}
3127

32-
/**
33-
* Reverse the migrations.
34-
*
35-
* @return void
36-
*/
3728
public function down()
3829
{
3930
Schema::drop('edited_message');
4031
}
41-
4232
}
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
46
use Illuminate\Database\Schema\Blueprint;
57

68
class CreateInlineQueryTable extends Migration
79
{
8-
9-
/**
10-
* Run the migrations.
11-
*
12-
* @return void
13-
*/
1410
public function up()
1511
{
16-
Schema::create('inline_query', function (Blueprint $table) {
12+
Schema::create('inline_query', static function (Blueprint $table) {
1713
$table->bigInteger('id')->unsigned()->primary()->comment('Unique identifier for this query');
1814
$table->bigInteger('user_id')->nullable()->index('user_id')->comment('Unique user identifier');
1915
$table->char('location')->nullable()->comment('Location of the user');
@@ -23,14 +19,8 @@ public function up()
2319
});
2420
}
2521

26-
/**
27-
* Reverse the migrations.
28-
*
29-
* @return void
30-
*/
3122
public function down()
3223
{
3324
Schema::drop('inline_query');
3425
}
35-
3626
}

0 commit comments

Comments
 (0)