Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: labboy0276 at Tandem commentedComment #3
labboy0276 CreditAttribution: labboy0276 at Tandem commentedPatch is attached.
Comment #4
heddnMinor improvements.
Comment #5
alexpottCommitted and pushed 71169689e9 to 9.0.x and 79c710773c to 8.9.x. Thanks!