diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 0000000..8b7463a --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -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/setup-php@2.26.0 + with: + php-version: '8.0' + + - name: Install composer dependencies + uses: ramsey/composer-install@v2 + + - name: Run PHPStan + run: vendor/bin/phpstan --error-format=github diff --git a/README.md b/README.md index d67a58c..e72d98d 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/composer.json b/composer.json index 3de2514..b590016 100644 --- a/composer.json +++ b/composer.json @@ -33,6 +33,11 @@ "common/helpers.php" ] }, + "autoload-dev": { + "psr-4": { + "LbilTech\\TelegramGitNotifier\\Tests\\": "tests" + } + }, "require": { "php": "^8.0", "eleirbag89/telegrambotphp": "^1.4", @@ -40,6 +45,9 @@ "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" }, diff --git a/src/Exceptions/TelegramGitNotifierException.php b/src/Exceptions/TelegramGitNotifierException.php index e9e0337..3d201ea 100644 --- a/src/Exceptions/TelegramGitNotifierException.php +++ b/src/Exceptions/TelegramGitNotifierException.php @@ -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'); } }