Skip to content

Commit 62a0c98

Browse files
committed
Use phive to install and run phpstan
1 parent 1a3cfcf commit 62a0c98

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111

1212
# Ignore files for distribution archives, generated using `git archive`
1313
.editorconfig export-ignore
14-
.git export-ignore
14+
.github export-ignore
1515
.gitattributes export-ignore
1616
.gitignore export-ignore
1717
phpcs.xml export-ignore
1818
phpunit.xml.dist export-ignore
1919
/CakePHP/Tests export-ignore
20+
phpstan.neon export-ignore
21+
.phive export-ignore

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,17 @@ jobs:
4949
uses: shivammathur/setup-php@v2
5050
with:
5151
php-version: '8.1'
52-
tools: cs2pr
52+
tools: phive, cs2pr
5353
coverage: none
5454

5555
- name: Composer install
5656
uses: ramsey/composer-install@v3
5757

58+
- name: Install PHP tools with phive.
59+
run: "phive install --trust-gpg-keys 'CF1A108D0E7AE720,51C67305FFC2E5C0,12CE0F1D262429A5'"
60+
5861
- name: Run PHP CodeSniffer
5962
run: vendor/bin/phpcs --report=checkstyle | cs2pr
6063

6164
- name: Run PHPStan
62-
run: vendor/bin/phpstan
65+
run: tools/phpstan analyse --error-format=github

.phive/phars.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phive xmlns="https://phar.io/phive">
3+
<phar name="phpstan" version="2.0.3" installed="2.0.3" location="./tools/phpstan" copy="false"/>
4+
</phive>

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"squizlabs/php_codesniffer": "^3.9"
2525
},
2626
"require-dev": {
27-
"phpstan/phpstan": "^2.0.3",
2827
"phpunit/phpunit": "^9.3.4"
2928
},
3029
"autoload": {
@@ -46,7 +45,7 @@
4645
],
4746
"cs-check": "phpcs --colors --parallel=16 -p -s CakePHP/",
4847
"cs-fix": "phpcbf --colors --parallel=16 -p CakePHP/",
49-
"stan": "phpstan analyse",
48+
"stan": "tools/phpstan analyse",
5049
"docs": "php docs/generate.php",
5150
"explain": "phpcs -e --standard=CakePHP"
5251
}

0 commit comments

Comments
 (0)