Part of meta-issue #2002650: [meta, no patch] improve maintainability by removing unused local variables
File /core/modules/system/lib/Drupal/system/Tests/Form/ElementsTableSelectTest.php
Line 169: Unused local variable $processed_form
Line 169: Unused local variable $form_state
Line 173: Unused local variable $processed_form
Line 173: Unused local variable $form_state
Line 194: Unused local variable $processed_form
Line 194: Unused local variable $form_state
Line 198: Unused local variable $processed_form
Line 198: Unused local variable $form_state
Comment | File | Size | Author |
---|---|---|---|
#1 | 2080095-remove-unused-local-variables-1.patch | 2.05 KB | rhm5000 |
Comments
Comment #1
rhm5000 CreditAttribution: rhm5000 commentedComment #2
longwaveI think the code is easier to read, and it will be easier to extend the tests in the future, if these variables are kept.
Comment #3
rhm5000 CreditAttribution: rhm5000 commented#2 is similar to the comment Remove Unused local variable $plugin from /core/modules/system/lib/Drupal/system/Plugin/Block/SystemMenuBlock.php comment#6. The list function's use is not defined in the coding standards and standard use of list should be defined because of the frequent use and multiple acceptable usages in PHP. Probably another issue.
Comment #4
areke CreditAttribution: areke commentedI agree with longwave. The code is 100 times more readable with the variables than without them. I'm going to close this issue because it doesn't make sense to remove unused local variables when they serve a purpose like this. Doing so would make it harder for others to contribute.