Skip to content

Commit

Permalink
workflow: add phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Oct 28, 2023
1 parent a4053ca commit 30ee579
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: PHPStan

on: [push, pull_request]

jobs:
phpstan:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/[email protected]
with:
php-version: '8.0'

- name: Install composer dependencies
uses: ramsey/composer-install@v2

- name: Run PHPStan
run: vendor/bin/phpstan --error-format=github
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Telegram Git Notifier

This package provides the ability to integrate the Telegram messaging service and GitHub/GitLab.
This package provides the ability to integrate the Telegram messaging service and GitHub and GitLab.
With this package,
you can create a Telegram bot to receive notifications from GitHub or GitLab events
and manage customization through messages and buttons on Telegram.
Expand Down
8 changes: 8 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,21 @@
"common/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"LbilTech\\TelegramGitNotifier\\Tests\\": "tests"
}
},
"require": {
"php": "^8.0",
"eleirbag89/telegrambotphp": "^1.4",
"guzzlehttp/guzzle": "^7.8",
"symfony/http-foundation": "^6.3",
"vlucas/phpdotenv": "^5.5"
},
"require-dev": {
"phpstan/phpstan": "^1.10.39"
},
"support": {
"issues": "https://github.com/lbiltech/telegram-git-notifier/issues"
},
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptions/TelegramGitNotifierException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class TelegramGitNotifierException extends Exception
{
public static function isEmpty(): self
{
return new static('Telegram Git Notifier is empty');
return new self('Telegram Git Notifier is empty');
}

public static function invalid(): self
{
return new static('Telegram Git Notifier is invalid');
return new self('Telegram Git Notifier is invalid');
}
}

0 comments on commit 30ee579

Please sign in to comment.