Throughout the code various function are using "element" but also "component" keyword such as getComponents(). As the term are so close, it make the code a bit hard to read.
I don't really understand what represent a "component". My understanding is that webform have only element and submissions.
It is particular strange when you have a function like that:
/**
* Get Components.
*
* @return array
* Components renderable.
*/
public function getComponents() {
foreach ($this->analysis->getElements() as $element_name => $element) {
$options[$element_name] = isset($element['#title']) ? $element['#title'] : $element_name;
}
return [
'#type' => 'checkboxes',
'#options' => $options,
'#default_value' => (array) $this->analysis->getComponents(),
];
}
This function actually getElements and construct a renderable array to construct the form checkbox. For example, buildFormWebformElementsCheckbox()
seem a better name to me.
Similarly, in the WebformAnalysis
class the function getComponentValuesCount($components)
could be getElementValuesCount(array $elementsName)
.
Active
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.