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.
Part of meta-issue #2002650: [meta, no patch] improve maintainability by removing unused local variables
File /core/modules/locale/locale.bulk.inc
Line 555: Unused local variable $filepath
Comment | File | Size | Author |
---|---|---|---|
#1 | drupal-core-remove-unused-local-variable-2080443.patch | 696 bytes | mrsinguyen |
Comments
Comment #1
mrsinguyen CreditAttribution: mrsinguyen commentedAttached patch.
Comment #2
boran CreditAttribution: boran commentedThe patch is a one liner, and looks good:
- grepped to look for $filepath, it is used in several places. In this case the variable not used within that scope.
- Also used phpstorm to "find usages", same result.
- According to the php spec, this patch uses foreach() correctly
http://php.net/manual/en/control-structures.foreach.php
- The patch applies cleanly and the variable is effectively removed.
- The sample website does not fall over.
Comment #3
boran CreditAttribution: boran commentedComment #4
alexpottCommitted a34cb25 and pushed to 8.x. Thanks!
Committed as part of a merged commit for #2002650: [meta, no patch] improve maintainability by removing unused local variables