Skip to content
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

Add PHP 8.4 compliance for 2.2 branch #285

Merged
merged 2 commits into from
Jul 25, 2024

Conversation

phil-davis
Copy link
Contributor

@phil-davis phil-davis commented Jul 25, 2024

Related issue sabre-io/event#123

  • keep running cs-fixer just on the oldest supported PHP 7.1 (it does a little bit different spacing for call-by-reference parameters if I run it in PHP 8)
  • run phpstan in both PHP 7.1 and PHP 8.4 to (hopefully) find all the "interesting" things
  • adjust nullable parameters to explictly have the ? to keep PHP 8.4 happy
    • turn off reportUnmatchedIgnoredErrors in PHPstan. PHPstan, when run in PHP 7.1, thinks that a call to startElementNs has a problem. But, when run with PHP 8.4, it correctly understands that the call is fine. So we don't want to report the unmatched ignored error.
  • specify the current minor version of PHP 9 (9.6) just so that it is explicit that 9.6.x should be used

@phil-davis phil-davis force-pushed the php-8.4-ci-for-2.2 branch from e223c27 to b16cd91 Compare July 25, 2024 07:41
if: matrix.code-analysis == 'yes'
run: php vendor/bin/php-cs-fixer fix --dry-run --diff
if: matrix.code-style == 'yes'
run: PHP_CS_FIXER_IGNORE_ENV=true php vendor/bin/php-cs-fixer fix --dry-run --diff
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is handy to specify if we want to run the "old" php-cs-fixer with a more modern version of PHP.
It is not essential to specify now, because we are only running it with PHP 7.1 in CI. But I will leave it here so I have it in future, it does no harm.

@phil-davis phil-davis marked this pull request as ready for review July 25, 2024 07:52
@phil-davis phil-davis changed the title Add PHP 8.4 to CI for 2.2 branch Add PHP 8.4 compliance for 2.2 branch Jul 25, 2024
@phil-davis
Copy link
Contributor Author

@cedric-anne here is what seems to be needed for https://github.com/sabre-io/xml 2.2 release series.

When this has been approved, I will apply similar to the later major release series.

@phil-davis phil-davis merged commit b95e035 into sabre-io:2.2 Jul 25, 2024
9 checks passed
@phil-davis phil-davis deleted the php-8.4-ci-for-2.2 branch July 25, 2024 08:16
@cedric-anne
Copy link
Contributor

Hi @phil-davis

This is weird, the 2.2.8 version cannot be downloade by composer, because it is not listed in https://repo.packagist.org/p2/sabre/xml.json . However, this version is present in the corresponding packagist page https://packagist.org/packages/sabre/xml#2.2.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants