- array_filter: documentation ( source)
- in_array: documentation ( source)
- array_walk: documentation ( source)
<?php
array_walk(array_filter($checkboxes, function($checkbox) use ($shapeCheckboxIds) {
/** @var NodeElement $checkbox */
return in_array($this->findClosestElement($checkbox, 'input')->getAttribute('id'), $shapeCheckboxIds);
}), function($checkbox) {
/** @var NodeElement $checkbox */
$checkbox->getParent()->click();
});