phpstan / phpstan-strict-rules

Extra strict and opinionated rules for PHPStan
MIT License
604 stars 48 forks source link

Add `uselessTrim` rule for useless `trim()` #220

Open mvorisek opened 1 year ago

mvorisek commented 1 year ago

This is a feature request to add uselessTrim like there is uselessCast.

repro: https://phpstan.org/r/daf97ab2-6a1b-4d54-a48e-d7503026c1c8

It should be possible for numeric-string, empty-string and known const strings.