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/xmlrpc/xmlrpc.server.inc
Line 216: Unused local variable $return_type
Comment | File | Size | Author |
---|---|---|---|
#8 | 2080709-remove-unused-variables-8.patch | 751 bytes | mikemiles86 |
#3 | 2080709-remove-unused-variables-3.patch | 673 bytes | chertzog |
#1 | 2080709-remove-unused-variables.patch | 643 bytes | chertzog |
Comments
Comment #1
chertzogComment #3
chertzogTry again.
Comment #4
longwaveIf we are to remove $return_type here I think a comment may be needed as to why we are calling array_shift(), as it is not immediately obvious.
Comment #5
areke CreditAttribution: areke commentedThis looks good. Thank you!
Comment #6
webchickYeah, a comment here would be good.
Comment #7
mikemiles86I'll take a stab at providing a helpful comment.
Comment #8
mikemiles86Added comment about why the $signature array is being shifted.
Comment #9
xjmLet's also check the rest of the module and confirm that there are no other unused local variables.
Comment #10
mikemiles86Comment #11
xjmComment #12
mikemiles86Checking for additional unused variables.
Comment #13
mikemiles86Comment #14
mikemiles86After applying the patch, and running inspector in PHPStorm no other unused variables were detected.
Comment #15
drewbyist CreditAttribution: drewbyist commentedComment #16
drewbyist CreditAttribution: drewbyist commentedTested site with XMLRPC enabled, appears good.
Comment #17
webchickThat works, thanks!
Committed and pushed to 8.x.