- 🇺🇸United States smustgrave
Running for 10.1 but don't expect a failure.
- Status changed to Needs work
almost 2 years ago 2:02am 16 February 2023 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
If we're going to remove this I think we should take the opportunity to make the code inside more consistent. In the loop we have
foreach (Element::children($widget) as $sub_key) { if (isset($widget[$sub_key]['#type']) && $widget[$sub_key]['#type'] == 'submit') { hide($widget[$sub_key]); $operations_elements[] = &$widget[$sub_key]; } }
and
foreach (Element::children($operations_elements) as $key) { show($operations_elements[$key]); }
I think now we're removing the $key from the containing loop we should be changing the first internal
Element::children()
to use$key
instead of$sub_key
because nowsub_
is pretty meaningless. - 🇳🇿New Zealand quietone
Change parent to the issue implementing the sniff.
- Status changed to Needs review
almost 2 years ago 9:36am 15 March 2023 - Status changed to RTBC
almost 2 years ago 1:46pm 15 March 2023 - 🇺🇸United States smustgrave
foreach (Element::children($operations_elements) as $sub_key) {
Will let the committer decide this one but not sure if this should be sub_key but since we used $key in the loop above it maybe it's fine.
- Status changed to Needs work
almost 2 years ago 1:53pm 15 March 2023 - 🇧🇪Belgium borisson_ Mechelen, 🇧🇪
No, making this sub key is super confusing, back to needs work imho.
- Status changed to Needs review
over 1 year ago 8:55am 27 March 2023 - 🇮🇳India Aziza Anwari Gujarat
Checked the patch given on #43 , it apply's cleanly and have also addressed the previous comments
+RTBC
- Status changed to RTBC
over 1 year ago 6:17am 28 March 2023 - 🇧🇪Belgium borisson_ Mechelen, 🇧🇪
- Status changed to Fixed
over 1 year ago 10:10am 28 March 2023 - 🇬🇧United Kingdom catch
In general I don't think we should treat array keys in foreach loops as unused but in this case it's improving readability overall so seems like a good change. Committed/pushed to 10.1.x, thanks!
Automatically closed - issue fixed for 2 weeks with no activity.