/** * @param HelperSelectorInterface $element * @param bool $throwExceptions * @return array */ public static function getElementData(HelperSelectorInterface $element, $throwExceptions = true) { $locators = array_keys($element->getCssSelectors()); $elements = self::findAllOfElements($element, $locators, $throwExceptions); $result = array_fill_keys($locators, null); foreach ($elements as $key => $subElement) { if (empty($subElement)) { continue; } $method = 'get' . ucfirst($key) . 'Data'; $result[$key] = $element->{$method}($subElement); } return $result; }