Skip to content

Use vendor/composer/installed.php in TodoByPackageVersionRule.php #147

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 1 commit into from
Jun 26, 2025

Conversation

ruudk
Copy link
Contributor

@ruudk ruudk commented Jun 24, 2025

Fixes #146

@ruudk
Copy link
Contributor Author

ruudk commented Jun 24, 2025

@staabm I think the failing test, is actually a wrong test. How could that ever have worked? Given that composer.json requires phpunit ^9 || ^10.5. So the TODO: phpunit/phpunit:<10 error can only happen on older PHP versions where it's even allowed.

@staabm
Copy link
Owner

staabm commented Jun 26, 2025

Given that composer.json requires phpunit ^9 || ^10.5. So the TODO: phpunit/phpunit:<10 error can only happen on older PHP versions where it's even allowed.

is it related to the same thing you are fixing here? phpstan-src itself used PHPunit 9.x for a long time and only recently updated to 11.x.

maybe the test worked because of the phpunit version in phpstan-src, as it seems it did not use the projects composer.json, as you said?

@ruudk
Copy link
Contributor Author

ruudk commented Jun 26, 2025

Yes I believe that is the case. Shall I fix the test?

@staabm
Copy link
Owner

staabm commented Jun 26, 2025

yes please do

@ruudk
Copy link
Contributor Author

ruudk commented Jun 26, 2025

@staabm Done

@ruudk ruudk force-pushed the fix-todo-by-package-version branch from 3ecbd42 to 1e7e972 Compare June 26, 2025 16:44
@ruudk
Copy link
Contributor Author

ruudk commented Jun 26, 2025

It's having issues with my fork, somehow. Not sure how I can resolve this.

@staabm staabm merged commit da684ec into staabm:main Jun 26, 2025
12 of 24 checks passed
@@ -11,7 +11,6 @@
// TODO: not-installed/package:<5 this should error because package is not in composer.json

// TODO: phpunit/phpunit:<9
// TODO: phpunit/phpunit:<10
Copy link
Owner

Choose a reason for hiding this comment

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

just realized after merge: next time don't delete such line but make it empty. that way you don't need unrelated changes in test expectations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah that's clever

@staabm
Copy link
Owner

staabm commented Jun 26, 2025

thank you!

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.

TodoByPackageVersionRule uses PHPStan's InstalledVersions class
2 participants