Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PHPStan config #4

Merged
merged 1 commit into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 3 additions & 25 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,18 @@ jobs:
operating-system: [ubuntu-latest]
php-versions: ["8.2", "8.3"]

name: PHP ${{ matrix.php-versions }} Static Analysis on ${{ matrix.operating-system }}

env:
PHP_EXTENSIONS: mbstring
key: cache-v1
name: PHPStan with PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }}

steps:
- uses: actions/checkout@v3

- name: Setup Cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.PHP_EXTENSIONS }}
key: ${{ env.key }}

- name: Cache PHP extensions
uses: actions/cache@v3
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.PHP_EXTENSIONS }}

###> Composer ###
- name: Install Composer packages
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
###< Composer ###

- name: Run PHPSTAN
run: $GITHUB_WORKSPACE/vendor/bin/phpstan --level=9 --error-format=github
run: $GITHUB_WORKSPACE/vendor/bin/phpstan --error-format=github
1 change: 0 additions & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.PHP_EXTENSIONS }}

- name: Install Composer packages
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/vendor/
/composer.lock

/.phpunit.result.cache
/phpstan.neon
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"ext-mbstring": "*"
},
"require-dev": {
"phpstan/phpstan": "^1.4",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^11.0"
},
"config": {
Expand Down
4 changes: 0 additions & 4 deletions phpstan.neon

This file was deleted.

6 changes: 6 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
level: 9

paths:
- src/
- tests/
6 changes: 6 additions & 0 deletions tests/SHA3ShakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public function testShake256(string $string, int $outputLength, string $expected
$this->assertEquals(SHA3Shake::shake256($string, $outputLength, true), \hex2bin($expected));
}

/**
* @return array<array{0: string, 1: int, 2: string}>
*/
public static function shake128Provider(): array
{
return [
Expand All @@ -60,6 +63,9 @@ public static function shake128Provider(): array
];
}

/**
* @return array<array{0: string, 1: int, 2: string}>
*/
public static function shake256Provider(): array
{
return [
Expand Down