coding-standard icon indicating copy to clipboard operation
coding-standard copied to clipboard

[UnusedVariable] Add setting to ignore destructuring

Open wdoug opened this issue 2 years ago • 0 comments

I know that PHP supports skipping elements when destructuring from an array:

$array = [1, 2, 3];
[, , $c] = $array;

However, I often find it nice to have named variables for destructuring even if they aren't all used.

Can we add a new setting for that rule similar to ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach that allows ignoring unused variables in destructuring?

wdoug avatar Jul 21 '21 15:07 wdoug