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.
Problem/Motivation
In review process for #2909366: Fix 'Drupal.Commenting.VariableComment.EmptyVar' coding standard I realized that $language in /core/modules/views/tests/src/FunctionalJavascript/GlossaryViewTest.php is actually never used and could be simple removed.
Proposed resolution
Remove $language var declaration.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#2 | cleanup_unused_variable-2914677-2.patch | 1.04 KB | zaporylie |
Comments
Comment #2
zaporylieAnd here's a patch.
Comment #3
joelpittetThat's straight forward. Thanks @zaporylie.
Comment #4
xjmComment #5
xjmLooks like this was indeed added in a new test in #2600804: AJAXified glossary view arguments fail when Language URL detection enabled and didn't really seem to exist before then.
Comment #6
zaporylieYes, sorry, I should have mentioned that in IS.
Comment #8
xjmAlright, I checked and confirmed this isn't used anywhere. There's a few other tests that have a similar variable that is actually used.
In
core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
, there's a similar local language variable that's saved and never used; it could be updated like this one is. I thought about whether we should do that in the same patch, but since the Glossary view one is a class member and could actually affect child tests on the off-chance there were any, I think it makes sense to have separate issues. I committed this one to 8.5.x only for that reason. We can add a followup for the Taxonomy view.Thanks @zaporylie!
Comment #9
zaporylieCreated #2920322: Unused local variable in TaxonomyTermViewTest