From 44fca45c82fce24a6565d7432b5e4f5406c759cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 8 Dec 2022 21:25:49 +0100 Subject: [PATCH 1/3] Don't fix PHP to 8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- .github/workflows/phpstan.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 1e43a0eb..64456203 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -9,14 +9,6 @@ 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 From 4ea3b30fbad6e3f966ffddfad698a4ff7615e89c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 8 Dec 2022 22:17:21 +0100 Subject: [PATCH 2/3] Use github action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- .github/workflows/phpstan.yml | 23 +++++++++-------------- phpstan.neon.dist | 2 +- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 64456203..690f9703 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -9,18 +9,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3.1.0 - - 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 + diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 63d89285..6f5fe642 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,6 +1,6 @@ parameters: level: 0 - excludes_analyse: + excludePaths: - vendor scanDirectories: - . From 8cfdfa3d3ed07868d5d57ae351b4b48719a73f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 8 Dec 2022 22:37:42 +0100 Subject: [PATCH 3/3] Update composer.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- composer.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 119e8c2e..e14afd81 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "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", @@ -12,8 +12,5 @@ "files": [ "scripts/vendor/qrcode.php" ] - }, - "scripts": { - "phpstan": "vendor/phpstan/phpstan/phpstan analyse -c phpstan.neon.dist" } }