-
-
Notifications
You must be signed in to change notification settings - Fork 14
fix: Refactor FileAnalyser instantiation with named arguments #42
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
Conversation
Updated the `FileAnalyser` constructor usage to leverage named arguments for improved clarity and maintainability. Added `IgnoreErrorExtensionProvider` as a dependency to align with updated requirements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Oh my! This PR just ended several hours of debugging for me. I have a project that I have been working on for a few weeks and have been using PestPHP and the type-coverage plugin. I wanted to experiment with one of the new Laravel 12 starter kits, so I created a new project and imported all my backend code and tests into the new project. Installed all the required dev packages for testing (over 80 assertions at the moment). All tests pass, as expected, but I get this error when running type coverage. So many rabbit holes! It's obvious what the problem was, but we all know your not suppose to change Thank you @thimarsola ! |
@thimarsola @nick-lai any chances to have this merged anytime soon? Thanks for your great work! 🚀 |
@LucaPipolo I'm waiting for the approval workflow to proceed with the completion of this Pull Request. |
I encountered the same issue and, upon quickly searching the repository's issues and PRs, found that @thimarsola had already created this PR. At that time, @nunomaduro might have been busy preparing for LaraconIN, so I assisted in reviewing the PR. After testing, I confirmed that this PR resolved the issue I faced, so I approved it and commented, "Looks good to me," awaiting further confirmation and merge from the maintainers. cc @owenvoke |
For those currently encountering this issue, there is a temporary mitigation. Until this PR is merged, you can lock the upstream dependency composer require phpstan/phpstan:2.1.6 --dev Because |
We should likely require a minimum of |
It is indeed necessary to adjust the minimum compatible version of PHPStan in composer.json, as follows: pest-plugin-type-coverage/composer.json Lines 16 to 21 in b9de2a1
"require": {
"php": "^8.2",
- "phpstan/phpstan": "^1.12.10|^2.1.4",
+ "phpstan/phpstan": "^2.1.7",
"tomasvotruba/type-coverage": "^1.0.0|^2.0.2",
"pestphp/pest-plugin": "^3.0.0"
}, However, I believe the main issue is that PHPStan did not adhere to the Semver guidelines when moving from |
This pull request includes a few updates to the
PHPStanAnalyser.php
file to enhance dependency injection and improve code readability. The most important changes include the addition of a new import and the refactoring of theFileAnalyser
instantiation to use named parameters.Dependency Injection and Code Readability Improvements:
src/PHPStanAnalyser.php
: Added theIgnoreErrorExtensionProvider
import to support the new dependency injection.public static function make(Container $container, array $rules, array $collector
insrc/PHPStanAnalyser.php
: Refactored theFileAnalyser
instantiation to use named parameters, including the newignoreErrorExtensionProvider
dependency.