Skip to content

Commit

Permalink
Merge pull request #4 from danielburger1337/stricter-phpstan
Browse files Browse the repository at this point in the history
Update PHPStan config
  • Loading branch information
danielburger1337 authored Feb 24, 2024
2 parents 29b08cc + 0802985 commit 1699e86
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 31 deletions.
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

0 comments on commit 1699e86

Please sign in to comment.