Skip to content

Commit 9ab603b

Browse files
jrfnljaapio
authored andcommitted
Psalm: switch from Phive to Composer
This switches the installation method for Psalm from Phive to Composer, while still using a Phar file for running Psalm. Includes: * Removing Psalm from the Phive configuration. * Adding Psalm to the Composer configuration. Includes upgrading from version `3.11.2` to version `4.8.1`. * Adjusting the script used in the `Makefile`. 👉 Please verify and test this as things work differently on different OS-es and this should work for you. * Adjusting the GH Actions script to use the Composer installed version of Psalm. Note: due to the committed `composer.lock` file, Psalm will not automatically upgrade when newer versions are available. Refs: * https://github.com/vimeo/psalm/releases * https://github.com/psalm/phar/releases
1 parent e45d003 commit 9ab603b

File tree

5 files changed

+64
-7
lines changed

5 files changed

+64
-7
lines changed

.github/workflows/push.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ jobs:
188188
with:
189189
php-version: ${{ matrix.php-versions }}
190190
extensions: ${{ env.extensions }}
191-
tools: psalm
192191
ini-values: memory_limit=2G, display_errors=On, error_reporting=-1
193192

194193
- name: Install Composer dependencies & cache dependencies
@@ -197,7 +196,7 @@ jobs:
197196
composer-options: --optimize-autoloader
198197

199198
- name: Run psalm
200-
run: psalm --output-format=github
199+
run: vendor/bin/psalm.phar --output-format=github
201200

202201

203202
bc_check:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ phpstan:
2525

2626
.PHONY: psalm
2727
psalm:
28-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.2 tools/psalm
28+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.3 vendor/bin/psalm.phar
2929

3030
.PHONY: test
3131
test:

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"ext-filter": "*"
2222
},
2323
"require-dev": {
24-
"mockery/mockery": "~1.3.2"
24+
"mockery/mockery": "~1.3.2",
25+
"psalm/phar": "^4.8"
2526
},
2627
"autoload": {
2728
"psr-4": {

composer.lock

Lines changed: 60 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phive.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
33
<phar name="phpunit" version="^9.2" installed="9.3.7" location="./tools/phpunit" copy="true"/>
4-
<phar name="psalm" version="^3.12.1" installed="3.12.1" location="./tools/psalm" copy="true"/>
54
</phive>

0 commit comments

Comments
 (0)