Problem/Motivation
Fix a bunch of errors reported by PHPStan Strict with all rules disabled, i.e, the "miscellaneous" errors before we can consider introducing strict.
Most of the things identified will be easy/sane DX things.
This issue enables checkInternalClassCaseSensitivity, as enforced by PHPStan Strict.
Steps to reproduce
Add checkInternalClassCaseSensitivity: true to the parameters section of core/phpstan.neon.dist and run phpstan.
Remaining tasks
- CI Pass
- Review.
User interface changes
None.
Introduced terminology
None.
API changes
None.
Data model changes
None.
Release notes snippet
Nil.
Issue fork drupal-3487218
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3487218-phpstan-strict--class-nameCase
changes, plain diff MR !10169
Comments
Comment #3
dpiComment #4
quietone commentedComment #5
dpiComment #6
smustgrave commentedOnly temporarily postponing pending feedback on #3487269: [meta] Resolve issues exposed by PHPStan Strict with all rules off (misc and core configuration changes)
If we decide there no harm in merging these we can put back into review and I'll put top of my list to review. Just want to make sure they'll be accepted first.
Comment #7
mstrelan commentedI have to agree with @dpi's summary in #3487269-9: [meta] Resolve issues exposed by PHPStan Strict with all rules off (misc and core configuration changes), these can and should be fixed regardless if phpstan or phpstan-strict are tools we use or don't use.
I've reviewed the MR and noted all changes are straightforward, and correctly match the expected class names. I also ran phpstan with
checkInternalClassCaseSensitivity: true(without the strict package) and verified the same 8 violations were reported.Have updated the IS with steps to reproduce not requiring the strict package.
Comment #8
mondrakeShouldn't we then enable the
checkInternalClassCaseSensitivityparameter in phpstan.neon so to prevent regressions?Comment #9
quietone commentedYes, let's prevent regressions. Is there a reason not to enable checkInternalClassCaseSensitivity?
Comment #10
mstrelan commentedAdded the param
Comment #11
mondrakeLooks good.
Comment #12
dpiComment #13
dpiLooks great!
Comment #16
larowlanCommitted to 11.x - thanks!