Skip to content

Commit 13082f8

Browse files
authored
chore: add phpstan for static analysis (#406)
1 parent e41b22a commit 13082f8

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.github/workflows/tests.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,17 @@ jobs:
4141
composer require friendsofphp/php-cs-fixer
4242
vendor/bin/php-cs-fixer fix --diff --dry-run .
4343
vendor/bin/php-cs-fixer fix --rules=native_function_invocation --allow-risky=yes --diff src
44+
45+
staticanalysis:
46+
runs-on: ubuntu-latest
47+
name: PHPStan Static Analysis
48+
steps:
49+
- uses: actions/checkout@v2
50+
- name: Install PHP
51+
uses: shivammathur/setup-php@v2
52+
with:
53+
php-version: '8.0'
54+
- name: Run Script
55+
run: |
56+
composer global require phpstan/phpstan
57+
~/.composer/vendor/bin/phpstan analyse src

src/JWT.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Exception;
88
use InvalidArgumentException;
99
use OpenSSLAsymmetricKey;
10+
use TypeError;
1011
use UnexpectedValueException;
1112
use DateTime;
1213
use stdClass;
@@ -229,6 +230,8 @@ public static function sign(string $msg, string|OpenSSLAsymmetricKey $key, strin
229230
throw new DomainException($e->getMessage(), 0, $e);
230231
}
231232
}
233+
234+
throw new DomainException('Algorithm not supported');
232235
}
233236

234237
/**

0 commit comments

Comments
 (0)