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 CI for PHP 8.3 and 8.4 #499

Merged
merged 11 commits into from
Jan 27, 2025

Conversation

alexander-schranz
Copy link
Contributor

@alexander-schranz alexander-schranz commented Jan 19, 2025

@Ocramius
Copy link
Member

@alexander-schranz sorry, I just managed to trigger CI here, and it's currently red

@alexander-schranz
Copy link
Contributor Author

alexander-schranz commented Jan 20, 2025

@Ocramius No problem, looks like it used the lock files I did a composer update now to update the dependencies.

Not sure about the --prefer-lowest maybe need add some conflicts, locally I get:

PHP Fatal error: Cannot redeclare class PHPCSStandards\Composer\Plugin\Installers\PHPCodeSniffer\Plugin (previously declared in /Users/alexanderschranz/Documents/Projects/infection-static-analysis-plugin/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php:35) in /Users/alexanderschranz/Documents/Projects/infection-static-analysis-plugin/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php on line 35

Or do you ever stumbled over this error?

@Ocramius
Copy link
Member

Or do you ever stumbled over this error?

Haven't been doing PHP for almost a year, so nope, didn't meet this error (yet) :D

@Ocramius Ocramius added enhancement New feature or request dependencies Pull requests that update a dependency file labels Jan 20, 2025
@Ocramius Ocramius added this to the 1.36.0 milestone Jan 20, 2025
…ent of not required to called parent construct
Comment on lines 28 to 30
/**
* @psalm-suppress ParamNameMismatch
*/
Copy link
Member

Choose a reason for hiding this comment

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

I'd rename the parameters, fwiw

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

TIL: weird that it is flagged by SA, since constructors don't adhere to variance checks

Comment on lines 78 to 79
- name: "Remove not required dev tools"
run: "composer remove vimeo/psalm --no-update --no-interaction --no-progress"
Copy link
Member

Choose a reason for hiding this comment

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

vimeo/psalm is not a dev tool: it's a direct non-dev dependency

Choose a reason for hiding this comment

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

Is psalm distributed as a PHAR file?

Copy link
Member

Choose a reason for hiding this comment

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

It's a runtime dependency, not a binary to include: it can't even be fully scoped, because we rely on symbols from its codebase.

Copy link
Contributor Author

@alexander-schranz alexander-schranz Jan 20, 2025

Choose a reason for hiding this comment

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

Then I think it is blocked until there is a stable release of psalm supporting 8.4:

vimeo/psalm#11176
vimeo/psalm#11107

@alexander-schranz alexander-schranz force-pushed the feature/php-8-4-compatibility branch from 3cbb2d7 to 76162c5 Compare January 20, 2025 14:01
@Ocramius Ocramius added the help wanted Extra attention is needed label Jan 20, 2025
@alexander-schranz
Copy link
Contributor Author

Psalm v6 was released: https://github.com/vimeo/psalm/releases/tag/6.0.0

Comment on lines 28 to 30
/**
* @psalm-suppress ParamNameMismatch
*/
Copy link
Member

Choose a reason for hiding this comment

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

TIL: weird that it is flagged by SA, since constructors don't adhere to variance checks

composer.lock Outdated Show resolved Hide resolved
@Ocramius Ocramius removed the help wanted Extra attention is needed label Jan 26, 2025
@Ocramius
Copy link
Member

Seems like infection itself also needs an upgrade

composer.json Outdated Show resolved Hide resolved
To do this, we introduced `azjezz/psl` in the test suite, since life is too short to follow PHP-SRC's function
falsyess bullshit.

Also, various suppressions are now gone, since Psalm and Infection removed various deprecations and
mutable expressions.

The `psalm/plugin-phpunit` was also installed, so Psalm does no longer mark test classes as unused code.
@Ocramius Ocramius self-assigned this Jan 27, 2025
…does that when `$codebase` files are invalidated
…pdbg`

Fixes:

```
Error: ] Project tests must be in a passing state before running Infection.
         Infection runs the test suite in a RANDOM order. Make sure your tests
         do not have hidden dependencies.

         You can add these attributes to `phpunit.xml` to check it: <phpunit
         executionOrder="random" resolveDependencies="true" ...

         If you don't want to let Infection run tests in a random order, set the
         `executionOrder` to some value, for example <phpunit
         executionOrder="default"

         Check the executed command to identify the problem:
         '/usr/bin/phpdbg8.2' '-qrr' '/github/workspace/vendor/bin/phpunit'
         '--configuration'
         '/tmp/infection/phpunitConfiguration.initial.infection.xml'
         '--coverage-xml=/tmp/infection/coverage-xml'
         '--log-junit=/tmp/infection/junit.xml'
         PHPUnit reported an exit code of 1.
         Refer to the PHPUnit's output below:
         STDOUT:
         PHPUnit 10.5.41 by Sebastian Bergmann and contributors.

         Runtime:       PHP 8.2.24
         Configuration:
         /tmp/infection/phpunitConfiguration.initial.infection.xml
         Random Seed:   1737943321

         There was 1 PHPUnit test runner warning:

         1) No code coverage driver available

         No tests executed!
```
@Ocramius Ocramius merged commit c4b2fe2 into Roave:1.36.x Jan 27, 2025
14 checks passed
@Ocramius
Copy link
Member

Shipping this after few adjustments then: thanks for the help, @alexander-schranz!

@alexander-schranz alexander-schranz deleted the feature/php-8-4-compatibility branch January 27, 2025 06:34
@alexander-schranz
Copy link
Contributor Author

@Ocramius thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants