Skip to content

Commit 46e7804

Browse files
authored
Merge pull request #1 from tanhongit/main
init
2 parents a8baaeb + dcb54c8 commit 46e7804

File tree

10 files changed

+214
-0
lines changed

10 files changed

+214
-0
lines changed

.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/vendor
2+
composer.lock
3+
composer.phar
4+
.DS_Store
5+
/node_modules
6+
/public/storage
7+
/storage/*.key
8+
Thumbs.db
9+
/bower_components
10+
11+
.env
12+
.env.backup
13+
.idea
14+
.vscode
15+
16+
.vagrant
17+
Homestead.json
18+
Homestead.yaml
19+
npm-debug.log
20+
21+
.phpunit.cache
22+
.phpunit.result.cache
23+
/storage/.license
24+
/storage/fonts
25+
/storage/installing
26+
/storage/installed
27+
/log
28+
29+
package-lock.json
30+
yarn.lock
31+
/.sass-cache

.scrutinizer.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
build:
2+
nodes:
3+
analysis:
4+
project_setup:
5+
override: true
6+
tests:
7+
override: [ php-scrutinizer-run ]
8+
environment:
9+
php:
10+
version: 8.0
11+
12+
checks:
13+
php:
14+
code_rating: true
15+
remove_extra_empty_lines: true
16+
remove_php_closing_tag: true
17+
remove_trailing_whitespace: true
18+
fix_use_statements:
19+
remove_unused: true
20+
preserve_multiple: false
21+
preserve_blanklines: true
22+
order_alphabetically: true
23+
fix_php_opening_tag: true
24+
fix_linefeed: true
25+
fix_line_ending: true
26+
fix_identation_4spaces: true
27+
fix_doc_comments: true
28+
29+
tools:
30+
php_analyzer: true
31+
php_code_coverage: true
32+
php_code_sniffer:
33+
config:
34+
standard: PSR4
35+
filter:
36+
paths: [ 'src' ]
37+
php_loc:
38+
enabled: true
39+
excluded_dirs: [ vendor ]
40+
php_cpd:
41+
enabled: true
42+
excluded_dirs: [ vendor ]

.styleci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
preset: laravel

common/helpers.php

Whitespace-only changes.

composer.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "lbiltech/laravel-telegram-git-notifier",
3+
"description": "Send notification from Gitlab and Github events to Telegram",
4+
"keywords": [
5+
"lbiltech",
6+
"telegram-bot",
7+
"notify",
8+
"git-webhook",
9+
"telegram-notifier",
10+
"telegram-git-notifier",
11+
"github-notifier",
12+
"gitlab-notifier",
13+
"github-telegram-bot",
14+
"gitlab-telegram-bot",
15+
"telegram-bot-github-notify",
16+
"telegram-bot-gitlab-notify"
17+
],
18+
"homepage": "https://github.com/lbiltech/laravel-telegram-git-notifier",
19+
"type": "library",
20+
"license": "MIT",
21+
"autoload": {
22+
"psr-4": {
23+
"LbilTech\\LaravelTelegramGitNotifier\\": "src/"
24+
}
25+
},
26+
"autoload-dev": {
27+
"psr-4": {
28+
"LbilTech\\LaravelTelegramGitNotifier\\Tests\\": "tests/"
29+
}
30+
},
31+
"authors": [
32+
{
33+
"name": "Tan Nguyen",
34+
"email": "tannp27@gmail.com",
35+
"homepage": "https://tanhongit.com",
36+
"role": "Lead"
37+
},
38+
{
39+
"name": "Xuan Thinh",
40+
"email": "pxthinh.vn@gmail.com",
41+
"role": "Developer"
42+
}
43+
],
44+
"require": {
45+
"php": "^8.0"
46+
},
47+
"require-dev": {
48+
"phpunit/phpunit": "^9.5|^10.0",
49+
"mockery/mockery": "^1.5"
50+
},
51+
"support": {
52+
"issues": "https://github.com/lbiltech/laravel-telegram-git-notifier/issues"
53+
},
54+
"extra": {
55+
"laravel": {
56+
"providers": [
57+
"LbilTech\\LaravelTelegramGitNotifier\\Providers\\TelegramGitNotifierServiceProvider"
58+
]
59+
}
60+
},
61+
"minimum-stability": "dev",
62+
"prefer-stable": true
63+
}

config/telegram-git-notifier.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
return [
4+
'app' => [
5+
'name' => env('APP_NAME', 'Laravel Telegram Git Notify'),
6+
],
7+
];

lang/en/app.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return [
4+
5+
];

routes/bot.php

Whitespace-only changes.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
3+
namespace LbilTech\LaravelTelegramGitNotifier\App\Providers;
4+
5+
use Illuminate\Support\ServiceProvider;
6+
7+
class TelegramGitNotifierServiceProvider extends ServiceProvider
8+
{
9+
/**
10+
* Bootstrap services.
11+
*
12+
* @return void
13+
*/
14+
public function boot(): void
15+
{
16+
$configPath = __DIR__.'/../../config/telegram-git-notifier.php';
17+
$this->publishes([
18+
$configPath => config_path('telegram-git-notifier.php'),
19+
], 'config');
20+
21+
$routePath = __DIR__.'/../../routes/bot.php';
22+
if (file_exists($routePath)) {
23+
$this->loadRoutesFrom($routePath);
24+
}
25+
26+
$helperPath = __DIR__.'/../../common/helpers.php';
27+
if (file_exists($helperPath)) {
28+
require_once $helperPath;
29+
}
30+
31+
$this->loadTranslationsFrom(__DIR__.'/../../lang', 'telegram-git-notifier');
32+
33+
$this->publishes([
34+
__DIR__.'/../../lang' => resource_path('lang/vendor/laravel-generator'),
35+
], 'lang');
36+
}
37+
38+
/**
39+
* Register services.
40+
*
41+
* @return void
42+
*/
43+
public function register(): void
44+
{
45+
$configPath = __DIR__.'/../../config/telegram-git-notifier.php';
46+
$this->mergeConfigFrom($configPath, 'telegram-git-notifier');
47+
}
48+
49+
/**
50+
* Get the services provided by the provider.
51+
*
52+
* @return array|null
53+
*/
54+
public function provides(): ?array
55+
{
56+
return ['telegram-git-notifier'];
57+
}
58+
}

tests/IntegrationTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
/*
4+
|--------------------------------------------------------------------------
5+
| Integration
6+
|--------------------------------------------------------------------------
7+
*/

0 commit comments

Comments
 (0)