Unused variable $display_name.
Unused variable $field_name.
Unused variable $filter_name.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | interdiff-3105981-2-8.txt | 469 bytes | hardik_patel_12 |
| #8 | 3105981-8.patch | 1.31 KB | hardik_patel_12 |
Unused variable $display_name.
Unused variable $field_name.
Unused variable $filter_name.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | interdiff-3105981-2-8.txt | 469 bytes | hardik_patel_12 |
| #8 | 3105981-8.patch | 1.31 KB | hardik_patel_12 |
Comments
Comment #2
hardik_patel_12 commentedKindly review a patch.
Comment #3
hardik_patel_12 commentedComment #4
longwaveEach of these changes has an extra space after "as".
Comment #5
hardik_patel_12 commentedKindly follow a new patch.
Comment #6
hardik_patel_12 commentedComment #7
hardik_patel_12 commentedComment #8
hardik_patel_12 commentedKindly review a new patch.
Comment #9
hardik_patel_12 commentedComment #10
longwaveComment #11
alexpottI don't think these variables are unused. Naming a key in a loop is useful even if that variable is not used later. It helps if the key is needed later or people looking at the later are wondering what the array is keyed by. Additionally PHPStorm doesn't not consider this variable unused.
As unused variables can be detecting via static analysis of the code potentially we could use https://github.com/sirbrillig/phpcs-variable-analysis + PHPCS to automatically check for unused variables and ensure that core doesn't have any. Doing this will be a bit of a big task because they are quite few patterns Drupal adopts that makes this tricky - for example hooks - even if the argument is not used it is best if it is declared on the hook implementation. So going to close this a won't fix.
If someone want to take on the task of adding the above library as a dev dependency and configuring and getting it to run on core that'd be great.