Skip to content

Commit 602c289

Browse files
authored
3.0 (#152)
1 parent 9c55568 commit 602c289

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1022
-810
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ trim_trailing_whitespace = true
1313

1414
[*.md]
1515
trim_trailing_whitespace = false
16+
17+
[*.{yml,yaml,json}]
18+
indent_size = 2

.gitattributes

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
33

44
# Ignore all test and documentation with "export-ignore".
5+
6+
/.github export-ignore
7+
/.editorconfig export-ignore
58
/.gitattributes export-ignore
69
/.gitignore export-ignore
7-
/.php-cs-fixer.dist.php export-ignore
8-
/phpunit.xml.dist export-ignore
9-
/.scrutinizer.yml export-ignore
1010
/tests export-ignore
11-
/.github export-ignore
11+
/UPGRADING.md export-ignore
12+
/phpstan.neon.dist export-ignore
13+
/phpstan-baseline.neon export-ignore
14+
/phpunit.xml.dist export-ignore

.github/workflows/code-coverage.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Unit test coverage
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
coverage:
9+
if: (github.repository == 'laravel-notification-channels/telegram') && "!contains(github.event.head_commit.message, 'skip ci')"
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: "latest"
21+
coverage: pcov
22+
23+
- name: Install dependencies
24+
uses: ramsey/composer-install@v2
25+
with:
26+
composer-options: "--prefer-dist"
27+
28+
- name: Execute tests
29+
run: vendor/bin/pest --coverage --coverage-clover build/pest.xml
30+
31+
- name: Upload to Codecov
32+
uses: codecov/codecov-action@v3
33+
with:
34+
token: ${{ secrets.CODECOV_TOKEN }}
35+
files: build/pest.xml
36+
verbose: true

.github/workflows/code-style.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1-
name: Code Style
1+
name: Fix PHP code style issues
22

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

59
jobs:
6-
phplint:
10+
code-style:
711
if: "!contains(github.event.head_commit.message, 'skip ci')"
8-
12+
913
runs-on: ubuntu-latest
10-
14+
1115
steps:
1216
- name: Checkout code
1317
uses: actions/checkout@v3
14-
15-
- name: "Laravel Pint"
16-
uses: aglipanci/[email protected]
1718
with:
18-
preset: laravel
19-
20-
- name: Commit changes to GitHub
19+
ref: ${{ github.head_ref }}
20+
21+
- name: Fix PHP code style issues
22+
uses: aglipanci/[email protected]
23+
24+
- name: Commit changes
2125
uses: stefanzweifel/git-auto-commit-action@v4
2226
with:
23-
commit_message: "PHP Style Change (Laravel Pint in CI)"
27+
commit_message: Fix styling
2428
env:
2529
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/coverage.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/phpstan.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: PHPStan
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'phpstan.neon.dist'
8+
9+
jobs:
10+
phpstan:
11+
if: "!contains(github.event.head_commit.message, 'skip ci')"
12+
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: '8.1'
21+
coverage: none
22+
23+
- name: Install composer dependencies
24+
uses: ramsey/composer-install@v2
25+
26+
- name: Run PHPStan
27+
run: ./vendor/bin/phpstan --error-format=github

.github/workflows/tests.yml

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,48 @@
11
name: PHPUnit tests
22

33
on:
4-
- push
5-
- pull_request
4+
- push
5+
- pull_request
66

77
jobs:
8-
tests:
9-
if: "!contains(github.event.head_commit.message, 'skip ci')"
10-
runs-on: ubuntu-latest
11-
continue-on-error: ${{ matrix.experimental }}
12-
strategy:
13-
fail-fast: true
14-
matrix:
15-
php: [7.4, 8.0, 8.1]
16-
stability: [prefer-lowest, prefer-stable]
17-
experimental: [false]
18-
name: Tests on PHP ${{ matrix.php }} - ${{ matrix.stability }}
19-
20-
steps:
21-
- name: Checkout code
22-
uses: actions/checkout@v2
23-
24-
- name: Setup PHP
25-
uses: shivammathur/setup-php@v2
26-
with:
27-
php-version: ${{ matrix.php }}
28-
tools: composer:v2
29-
coverage: none
30-
31-
- name: Install dependencies
32-
run: composer update --${{ matrix.stability }} --prefer-source --no-interaction --no-progress
33-
34-
- name: Execute tests
35-
run: vendor/bin/phpunit --verbose
8+
tests:
9+
if: "!contains(github.event.head_commit.message, 'skip ci')"
10+
11+
runs-on: ubuntu-latest
12+
continue-on-error: ${{ matrix.experimental }}
13+
strategy:
14+
fail-fast: true
15+
matrix:
16+
php: [8.0, 8.1]
17+
dependencies: [lowest, highest]
18+
experimental: [false]
19+
20+
name: PHP ${{ matrix.php }} (${{ matrix.dependencies }})
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v3
25+
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ matrix.php }}
30+
tools: composer:v2
31+
coverage: none
32+
33+
- name: Setup problem matchers
34+
run: |
35+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
36+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
37+
38+
- name: Install dependencies
39+
uses: ramsey/composer-install@v2
40+
with:
41+
dependency-versions: ${{ matrix.dependencies }}
42+
composer-options: "--prefer-dist ${{ matrix.composer-options }}"
43+
44+
- name: List Installed Dependencies
45+
run: composer show -D
46+
47+
- name: Execute tests
48+
run: ./vendor/bin/pest
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Update Changelog"
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
update:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
with:
15+
ref: ${{ github.event.release.target_commitish }}
16+
17+
- name: Update Changelog
18+
uses: stefanzweifel/changelog-updater-action@v1
19+
with:
20+
latest-version: ${{ github.event.release.name }}
21+
release-notes: ${{ github.event.release.body }}
22+
23+
- name: Commit updated CHANGELOG
24+
uses: stefanzweifel/git-auto-commit-action@v4
25+
with:
26+
branch: master
27+
commit_message: Update CHANGELOG
28+
file_pattern: CHANGELOG.md

.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
/vendor
1+
vendor
22
build
3-
composer.phar
4-
composer.lock
5-
.php-cs-fixer.php
6-
.php-cs-fixer.cache
73
.phpunit.result.cache
4+
composer.lock
5+
phpunit.xml
6+
phpstan.neon

.scrutinizer.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
All notable changes to `telegram` will be documented in this file
44

5-
## Unreleased
6-
75
## 2.0.0 - 2022-02-11
86

97
- Add Laravel 9 Support.
@@ -12,7 +10,7 @@ All notable changes to `telegram` will be documented in this file
1210

1311
## 1.0.0 - 2021-12-11
1412

15-
- Register Telegram instance to container.
13+
- Register Telegram instance to container.
1614
- Add `TelegramUpdates` to retrieve bot updates. PR [#133](https://github.com/laravel-notification-channels/telegram/pull/133).
1715
- Refactor TelegramChannel. PR [#136](https://github.com/laravel-notification-channels/telegram/pull/136).
1816
- Add Retrieving Chat ID docs and improve docs.

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
[![Chat on Telegram][ico-telegram]][link-telegram]
55
[![Latest Version on Packagist][ico-version]][link-packagist]
66
[![Software License][ico-license]](LICENSE.md)
7-
[![Quality Score][ico-code-quality]][link-code-quality]
87
[![Total Downloads][ico-downloads]][link-packagist]
98

109
This package makes it easy to send Telegram notification using [Telegram Bot API](https://core.telegram.org/bots) with Laravel.
@@ -378,6 +377,7 @@ Notification::send($recipients, new InvoicePaid());
378377
For more information on supported parameters, check out these [docs](https://telegram-bot-sdk.readme.io/docs/sendmessage).
379378

380379
- `content(string $content, int $limit = null)`: Notification message, supports markdown. For more information on supported markdown styles, check out these [docs](https://telegram-bot-sdk.readme.io/reference#section-formatting-options).
380+
- `line(string $content)`: Adds a message in a new line.
381381
- `view(string $view, array $data = [], array $mergeData = [])`: (optional) Blade template name with Telegram supported HTML or Markdown syntax content if you wish to use a view file instead of the `content()` method.
382382
- `chunk(int $limit = 4096)`: (optional) Message chars chunk size to send in parts (For long messages). Note: Chunked messages will be rate limited to one message per second to comply with rate limitation requirements from Telegram.
383383

@@ -446,19 +446,15 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio
446446
[ico-telegram]: https://img.shields.io/badge/@PHPChatCo-2CA5E0.svg?style=flat-square&logo=telegram&label=Telegram
447447
[ico-version]: https://img.shields.io/packagist/v/laravel-notification-channels/telegram.svg?style=flat-square
448448
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
449-
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/laravel-notification-channels/telegram.svg?style=flat-square
450-
[ico-code-quality]: https://img.shields.io/scrutinizer/g/laravel-notification-channels/telegram.svg?style=flat-square
451449
[ico-downloads]: https://img.shields.io/packagist/dt/laravel-notification-channels/telegram.svg?style=flat-square
452450

453451
[link-phpchat]: https://phpchat.co/?ref=laravel-channel-telegram
454452
[link-telegram]: https://t.me/PHPChatCo
455453
[link-repo]: https://github.com/laravel-notification-channels/telegram
456454
[link-packagist]: https://packagist.org/packages/laravel-notification-channels/telegram
457-
[link-scrutinizer]: https://scrutinizer-ci.com/g/laravel-notification-channels/telegram/code-structure
458-
[link-code-quality]: https://scrutinizer-ci.com/g/laravel-notification-channels/telegram
459455
[link-author]: https://github.com/irazasyed
460456
[link-contributors]: ../../contributors
461-
[link-notification-facade]: https://laravel.com/docs/8.x/notifications#using-the-notification-facade
462-
[link-on-demand-notifications]: https://laravel.com/docs/8.x/notifications#on-demand-notifications
457+
[link-notification-facade]: https://laravel.com/docs/9.x/notifications#using-the-notification-facade
458+
[link-on-demand-notifications]: https://laravel.com/docs/9.x/notifications#on-demand-notifications
463459
[link-telegram-docs-update]: https://core.telegram.org/bots/api#update
464460
[link-telegram-docs-getupdates]: https://core.telegram.org/bots/api#getupdates

0 commit comments

Comments
 (0)