Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix psalm install error on future php releases #930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions 3 composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*"
Expand Down
17 changes: 17 additions & 0 deletions 17 tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
17 changes: 9 additions & 8 deletions 17 tests/run_coding_standards_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 14 additions & 10 deletions 24 tests/run_static_analysis_check_psalm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

if [[ "${?}" -ne 0 ]]; then
echo "❌ Error: psalm static analysis check failed"
errors+=("psalm static analysis check failed")
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"
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.