Hello
I was recently looking at the substr plugin and noticed it had a couple small issues according to the PHP Inspections (EA Extended) plugin for PHP Storm. The 2 issues are:
1. is_null should not be used any longer. Per the plugin:
All 'is_null(...)' calls can be safely replaced with 'null === ...' constructs (or 'null !== ...' if the original construct was negated).
2. The return statement is redundant:
Variable $new_value is redundant. In some cases one-time use variable are simply not needed.
I know these are minor, but every little performance gain helps in the end. Patch to follow in comment.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3087461-substr-3.patch | 1.25 KB | labboy0276 |
Comments
Comment #2
labboy0276 commentedComment #3
labboy0276 commentedPatch is attached.
Comment #4
heddnMinor improvements.
Comment #5
alexpottCommitted and pushed 71169689e9 to 9.0.x and 79c710773c to 8.9.x. Thanks!