-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 PHPStan analysis #66598
Comments
@justlevine I agree 👏. I'd be interested in helping to enable PHPStan for Gutenberg and can submit a draft PR sometime this month (unless you would like to work on it yourself). |
@anton-vlasenko this is a great point I hadn't considered. Personally, I'd recommend baselining the error until it gets remediated upstream in core, but I'm assuming there's enough preexisting tech debt in Gutenberg alone to keep us busy before an actual decision needs to be made about what PHPStan level gets committed.
My plan was to get a draft PR up over the weekend (so I can start remediating errors over the rest of the current mentorship cohort), but I'll likely need help getting the |
Great! This works for me.
For |
Did a first pass over in #66693 . Still need work (e.g. https://github.com/WordPress/gutenberg/pull/66693/files#r1826604652 ), but even already, there's a good amount of unsurfaced errors that can be triaged via the baselines. |
Parallel to this PR, I've begun remediating Level 0 and Level 1 errors over in justlevine#1 and cherry-picking the commits that aren't solely to suppress PHPStan errors into individual PRs (linked to this issue). The diffs for the |
Update: the majority of the level 0-3 issues have been remediated and cherrypicked as PRs onto Could use some more feedback/collab on #66693. In the mean time, I'm moving on to any low-hanging fruit in levels 4+ |
What problem does this address?
Parallel to efforts in WordPress core, we should consider implementing PHPStan Analysis on the Gutenberg codebase.
Based on the success the Performance team has seen with implementing PHPStan, I would recommend we implement PHPStan regardless (and even to a stricter extent) of what makes it into WordPress core.
What is your proposed solution?
The text was updated successfully, but these errors were encountered: