Problem/Motivation
In #3106216: Remove unused variables from core we introduced the sniff DrupalPractice.CodeAnalysis.VariableAnalysis
to detect unused variables in Drupal Core.
To narrow the scope the decision was made to exclude all the test-classes.
This issue is created to make that sniff run without errors on all test-classes.
Steps to reproduce
Proposed resolution
- Remove the line <exclude-pattern>*/tests/*</exclude-pattern>
from sniff DrupalPractice.CodeAnalysis.VariableAnalysis
in core/phpcs.xml.dist
- Fix all and any errors