Skip to content

Commit e8bb4b6

Browse files
committed
WIP
1 parent 6dc31fb commit e8bb4b6

File tree

7 files changed

+107
-115
lines changed

7 files changed

+107
-115
lines changed

.gitattributes

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
* text=auto
22

3-
/.editorconfig export-ignore
4-
/.gitattributes export-ignore
5-
/.github export-ignore
6-
/.gitignore export-ignore
7-
/.php_cs.dist export-ignore
8-
/phpunit.xml.dist export-ignore
9-
/tests export-ignore
3+
/tests export-ignore
4+
/.github export-ignore
5+
.editorconfig export-ignore
6+
.gitattributes export-ignore
7+
.gitignore export-ignore
8+
phpunit.xml.dist export-ignore
9+
README.md export-ignore
10+
docgen.php export-ignore
11+
rector.php export-ignore

.github/workflows/code-style.yml

+7-21
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
11
name: Code Style
22

3-
on: [push]
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'code-style.yml'
48

59
jobs:
6-
php-cs-fixer:
7-
runs-on: ubuntu-latest
8-
9-
steps:
10-
- name: Checkout code
11-
uses: actions/checkout@v2
12-
with:
13-
ref: ${{ github.head_ref }}
14-
15-
- name: Run PHP CS Fixer
16-
uses: docker://oskarstark/php-cs-fixer-ga
17-
with:
18-
args: --config=.php_cs.dist --allow-risky=yes
19-
20-
- name: Commit changes
21-
uses: stefanzweifel/git-auto-commit-action@v4
22-
with:
23-
commit_message: Apply PHP CS Fixer changes
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10+
code-style:
11+
uses: telegram-bot-sdk/.github/.github/workflows/code-style.yml@main

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
.discovery
12
build
23
composer.lock
34
vendor
45
phpunit.xml
56
.phpunit.result.cache
6-
.php_cs.cache

.php_cs.dist

-38
This file was deleted.

composer.json

+47-29
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "telegram-bot-sdk/laravel",
3-
"type": "library",
43
"description": "Laravel Package for Telegram Bot SDK",
4+
"license": "BSD-3-Clause",
5+
"type": "library",
56
"keywords": [
67
"telegram bot sdk laravel",
78
"php telegram bot",
@@ -11,61 +12,78 @@
1112
"laravel telegram bot sdk",
1213
"telegram-bot-sdk"
1314
],
14-
"homepage": "https://github.com/telegram-bot-sdk/laravel",
15-
"license": "BSD-3-Clause",
1615
"authors": [
1716
{
1817
"name": "Irfaq Syed",
1918
"homepage": "https://github.com/irazasyed"
2019
}
2120
],
21+
"homepage": "https://github.com/telegram-bot-sdk/laravel",
22+
"support": {
23+
"issues": "https://github.com/telegram-bot-sdk/laravel/issues",
24+
"forum": "https://phpchat.co",
25+
"chat": "https://t.me/PHPChatCo",
26+
"source": "https://github.com/telegram-bot-sdk/laravel",
27+
"docs": "https://telegram-bot-sdk.com"
28+
},
2229
"require": {
2330
"illuminate/console": "^10",
2431
"telegram-bot-sdk/telegram-bot-sdk": "^4.0@dev"
2532
},
2633
"require-dev": {
27-
"phpunit/phpunit": "^9.6"
34+
"irazasyed/docgen": "^0.2",
35+
"pestphp/pest": "^2.0",
36+
"php-parallel-lint/php-parallel-lint": "^1.3",
37+
"rector/rector": "^0.15.24"
2838
},
2939
"suggest": {
3040
"irazasyed/larasupport": "Allows you to use any Laravel Package in Lumem"
3141
},
42+
"minimum-stability": "dev",
43+
"prefer-stable": true,
44+
"autoload": {
45+
"psr-4": {
46+
"Telegram\\Bot\\Laravel\\": "src/"
47+
}
48+
},
49+
"autoload-dev": {
50+
"psr-4": {
51+
"Telegram\\Bot\\Laravel\\Tests\\": "tests/"
52+
}
53+
},
3254
"config": {
55+
"allow-plugins": {
56+
"pestphp/pest-plugin": true,
57+
"thecodingmachine/discovery": true
58+
},
3359
"preferred-install": "dist",
3460
"sort-packages": true
3561
},
3662
"extra": {
3763
"branch-alias": {
38-
"dev-master": "4.x-dev"
64+
"dev-main": "4.x-dev"
3965
},
4066
"laravel": {
41-
"providers": [
42-
"Telegram\\Bot\\Laravel\\TelegramServiceProvider"
43-
],
4467
"aliases": {
4568
"Telegram": "Telegram\\Bot\\Laravel\\Facades\\Telegram"
46-
}
47-
}
48-
},
49-
"autoload": {
50-
"psr-4": {
51-
"Telegram\\Bot\\Laravel\\": "src/"
52-
}
53-
},
54-
"autoload-dev": {
55-
"psr-4": {
56-
"Telegram\\Bot\\Laravel\\Tests\\": "tests/"
69+
},
70+
"providers": [
71+
"Telegram\\Bot\\Laravel\\TelegramServiceProvider"
72+
]
5773
}
5874
},
59-
"minimum-stability": "dev",
60-
"prefer-stable": true,
6175
"scripts": {
62-
"test": "phpunit"
63-
},
64-
"support": {
65-
"issues": "https://github.com/telegram-bot-sdk/laravel/issues",
66-
"forum": "https://phpchat.co",
67-
"chat": "https://t.me/PHPChatCo",
68-
"source": "https://github.com/telegram-bot-sdk/laravel",
69-
"docs": "https://telegram-bot-sdk.com"
76+
"docgen": "docgen",
77+
"refactor": "rector --debug",
78+
"test": [
79+
"@test:lint",
80+
"@test:refactor",
81+
"@test:unit"
82+
],
83+
"test:coverage": "pest --coverage --colors=always",
84+
"test:docgen": "docgen -d",
85+
"test:lint": "parallel-lint . --blame --colors --exclude vendor",
86+
"test:refactor": "rector --dry-run",
87+
"test:unit": "pest --colors=always"
7088
}
7189
}

docgen.php

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
return [
4+
'facade' => Telegram\Bot\Laravel\Facades\Telegram::class,
5+
6+
'classes' => [
7+
\Telegram\Bot\BotsManager::class,
8+
\Telegram\Bot\Api::class => [
9+
'setContainer',
10+
'getWebhookUpdates',
11+
],
12+
\Telegram\Bot\Commands\CommandBus::class => [
13+
'getTelegram',
14+
'setTelegram',
15+
],
16+
],
17+
18+
'excludedMethods' => [],
19+
];

phpunit.xml.dist

+24-19
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
34
backupGlobals="false"
45
backupStaticAttributes="false"
6+
bootstrap="vendor/autoload.php"
57
colors="true"
6-
verbose="true"
78
convertErrorsToExceptions="true"
89
convertNoticesToExceptions="true"
910
convertWarningsToExceptions="true"
1011
processIsolation="false"
11-
stopOnFailure="false">
12-
<testsuites>
13-
<testsuite name="Telegram Bot SDK Laravel Test Suite">
14-
<directory suffix="Test.php">tests</directory>
15-
</testsuite>
16-
</testsuites>
17-
<filter>
18-
<whitelist>
19-
<directory suffix=".php">src/</directory>
20-
</whitelist>
21-
</filter>
22-
<logging>
23-
<log type="junit" target="build/report.junit.xml"/>
24-
<log type="coverage-html" target="build/coverage"/>
25-
<log type="coverage-text" target="build/coverage.txt"/>
26-
<log type="coverage-clover" target="build/logs/clover.xml"/>
27-
</logging>
12+
stopOnFailure="false"
13+
executionOrder="random"
14+
failOnWarning="true"
15+
failOnRisky="true"
16+
failOnEmptyTestSuite="true"
17+
forceCoversAnnotation="false"
18+
beStrictAboutCoversAnnotation="false"
19+
beStrictAboutOutputDuringTests="true"
20+
beStrictAboutTodoAnnotatedTests="true"
21+
convertDeprecationsToExceptions="true"
22+
verbose="true">
23+
<testsuites>
24+
<testsuite name="Telegram Bot SDK Laravel Test Suite">
25+
<directory suffix=".php">tests</directory>
26+
</testsuite>
27+
</testsuites>
28+
<coverage>
29+
<include>
30+
<directory suffix=".php">src</directory>
31+
</include>
32+
</coverage>
2833
</phpunit>

0 commit comments

Comments
 (0)