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 #2450

Merged
merged 3 commits into from
Dec 8, 2022
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
31 changes: 9 additions & 22 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
- name: Change PHP version
run: |
sudo update-alternatives --set php /usr/bin/php8.0
sudo update-alternatives --set phar /usr/bin/phar8.0
sudo update-alternatives --set phpdbg /usr/bin/phpdbg8.0
sudo update-alternatives --set php-cgi /usr/bin/php-cgi8.0
sudo update-alternatives --set phar.phar /usr/bin/phar.phar8.0
php -version
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3.0.11

- name: Install composer
uses: php-actions/composer@v6

- name: Run PHPStan
uses: php-actions/phpstan@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest
- name: Run phpstan
run: composer run-script phpstan
configuration: phpstan.neon.dist
memory_limit: 256M

5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
"description": "Pi-hole Dashboard for stats and more",
"require": {
"php": ">=5.4",
"phpstan/phpstan": "^0.12.42"
"phpstan/phpstan": "1.*"
},
"license": "EUPL-1.2",
"minimum-stability": "stable",
"autoload": {
"files": [
"scripts/vendor/qrcode.php"
]
},
"scripts": {
"phpstan": "vendor/phpstan/phpstan/phpstan analyse -c phpstan.neon.dist"
}
}
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
level: 0
excludes_analyse:
excludePaths:
- vendor
scanDirectories:
- .
Expand Down