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

Command icon 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:

Comments

dpi created an issue. See original summary.

dpi’s picture

Status: Active » Needs review
quietone’s picture

Version: 11.1.x-dev » 11.x-dev
dpi’s picture

smustgrave’s picture

Status: Needs review » Postponed

Only 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.

mstrelan’s picture

Issue summary: View changes
Status: Postponed » Reviewed & tested by the community

I 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.

mondrake’s picture

Shouldn't we then enable the checkInternalClassCaseSensitivity parameter in phpstan.neon so to prevent regressions?

quietone’s picture

Status: Reviewed & tested by the community » Needs work

Yes, let's prevent regressions. Is there a reason not to enable checkInternalClassCaseSensitivity?

mstrelan’s picture

Status: Needs work » Needs review

Added the param

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

dpi’s picture

Issue summary: View changes
dpi’s picture

Looks great!

  • larowlan committed b8926e0e on 11.x
    Issue #3487218 by dpi, mstrelan: Resolve PHPStan-Strict errors: class....
larowlan’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 11.x - thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.