Skip to content

Commit

Permalink
Use phive to install and run phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Nov 30, 2024
1 parent 1a3cfcf commit 3c23ac8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@

# Ignore files for distribution archives, generated using `git archive`
.editorconfig export-ignore
.git export-ignore
.github export-ignore
.gitattributes export-ignore
.gitignore export-ignore
phpcs.xml export-ignore
phpunit.xml.dist export-ignore
/CakePHP/Tests export-ignore
phpstan.neon export-ignore
.phive export-ignore
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: cs2pr
tools: phive, cs2pr
coverage: none

- name: Composer install
uses: ramsey/composer-install@v3

- name: Install PHP tools with phive.
run: "phive install --trust-gpg-keys 'CF1A108D0E7AE720,51C67305FFC2E5C0,12CE0F1D262429A5'"

- name: Run PHP CodeSniffer
run: vendor/bin/phpcs --report=checkstyle | cs2pr

- name: Run PHPStan
run: vendor/bin/phpstan
run: tools/phpstan analyse --error-format=github
4 changes: 4 additions & 0 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="2.0.3" installed="2.0.3" location="./tools/phpstan" copy="false"/>
</phive>
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"squizlabs/php_codesniffer": "^3.9"
},
"require-dev": {
"phpstan/phpstan": "^2.0.3",
"phpunit/phpunit": "^9.3.4"
},
"autoload": {
Expand All @@ -46,7 +45,7 @@
],
"cs-check": "phpcs --colors --parallel=16 -p -s CakePHP/",
"cs-fix": "phpcbf --colors --parallel=16 -p CakePHP/",
"stan": "phpstan analyse",
"stan": "tools/phpstan analyse",
"docs": "php docs/generate.php",
"explain": "phpcs -e --standard=CakePHP"
}
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ parameters:
paths:
- CakePHP/Sniffs/
bootstrapFiles:
- %rootDir%/../../../tests/phpstan_bootstrap.php
- tests/phpstan_bootstrap.php
ignoreErrors:
- identifier: missingType.iterableValue

0 comments on commit 3c23ac8

Please sign in to comment.