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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rhm5000’s picture

Status: Active » Needs review
FileSize
2.05 KB
longwave’s picture

I think the code is easier to read, and it will be easier to extend the tests in the future, if these variables are kept.

rhm5000’s picture

#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.

areke’s picture

Issue summary: View changes
Status: Needs review » Closed (works as designed)

I 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.