Fix psalm install error on future php releases (#930)

* Skip running psalm on future PHP releases

* Clean up indentation
This commit is contained in:
Zach Borboa
2025-03-08 09:18:08 -05:00
committed by GitHub
parent 58962a054e
commit a64fad2a9d
4 changed files with 40 additions and 19 deletions
+1 -2
View File
@@ -29,8 +29,7 @@
"phpcsstandards/phpcsutils": "@alpha",
"phpstan/phpstan": "*",
"phpunit/phpunit": "*",
"squizlabs/php_codesniffer": "*",
"vimeo/psalm": ">=5.26.1"
"squizlabs/php_codesniffer": "*"
},
"suggest": {
"ext-mbstring": "*"
+17
View File
@@ -6,6 +6,23 @@ errors=()
if [[ "${CI}" == "true" ]]; then
composer self-update
# Skip attempting to install psalm on future PHP releases to avoid the
# following error that would otherwise block the remaining tests from
# running:
# Your requirements could not be resolved to an installable set of packages.
#
# Problem 1
# - Root composer.json requires vimeo/psalm >=5.26.1 -> satisfiable by vimeo/psalm[5.26.1, 6.0.0, ..., 6.8.8].
# - vimeo/psalm 5.26.1 requires php ^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 -> your php version (8.5.0-dev) does not satisfy that requirement.
# - vimeo/psalm[6.0.0, ..., 6.5.0] require php ~8.1.17 || ~8.2.4 || ~8.3.0 || ~8.4.0 -> your php version (8.5.0-dev) does not satisfy that requirement.
# - vimeo/psalm[6.5.1, ..., 6.8.8] require php ~8.1.31 || ~8.2.27 || ~8.3.16 || ~8.4.3 -> your php version (8.5.0-dev) does not satisfy that requirement.
#
# Error: Your requirements could not be resolved to an installable set of packages.
if ! "${CI_PHP_FUTURE_RELEASE}"; then
composer require --dev "vimeo/psalm:>=5.26.1"
fi
composer install --prefer-source --no-interaction
if [[ "${?}" -ne 0 ]]; then
echo "❌ Error: composer install failed"
+9 -8
View File
@@ -123,14 +123,15 @@ fi
# https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8300
if [[ $(echo "${CI_PHP_VERSION} < 8.4" | bc -l) -eq 1 ]]; then
# Run PHP-CS-Fixer.
vendor/bin/php-cs-fixer --version
vendor/bin/php-cs-fixer fix --ansi --config="tests/.php-cs-fixer.php" --diff --dry-run
if [[ "${?}" -ne 0 ]]; then
echo "❌ Error: found PHP-CS-Fixer coding standard violation(s)"
errors+=("found PHP-CS-Fixer coding standard violation(s)")
fi
# Run PHP-CS-Fixer.
vendor/bin/php-cs-fixer --version
vendor/bin/php-cs-fixer fix --ansi --config="tests/.php-cs-fixer.php" --diff --dry-run
if [[ "${?}" -ne 0 ]]; then
echo "❌ Error: found PHP-CS-Fixer coding standard violation(s)"
errors+=("found PHP-CS-Fixer coding standard violation(s)")
fi
else
echo "⚠️ Skipped running PHP-CS-Fixer coding standards check"
fi
popd
+13 -9
View File
@@ -10,17 +10,21 @@ pushd ..
set -x
vendor/bin/psalm --version
if [[ $(echo "${CI_PHP_VERSION} == 7.4" | bc -l) -eq 1 ]]; then
vendor/bin/psalm --config="tests/psalm_7.4.xml"
if [[ ! -f "vendor/bin/psalm" ]]; then
echo "⚠️ Skipped running psalm static analysis check"
else
vendor/bin/psalm --config="tests/psalm.xml"
fi
vendor/bin/psalm --version
if [[ "${?}" -ne 0 ]]; then
echo "❌ Error: psalm static analysis check failed"
errors+=("psalm static analysis check failed")
if [[ $(echo "${CI_PHP_VERSION} == 7.4" | bc -l) -eq 1 ]]; then
vendor/bin/psalm --config="tests/psalm_7.4.xml"
else
vendor/bin/psalm --config="tests/psalm.xml"
fi
if [[ "${?}" -ne 0 ]]; then
echo "❌ Error: psalm static analysis check failed"
errors+=("psalm static analysis check failed")
fi
fi
popd