protected function addElementRules(ElementInterface $element, AttributeCollection $collection)
    {
        if ($element->hasOption('rules') && count($element->getOption('rules'))) {
            $rules = $this->formatter->formatRules($element->getOption('rules'));
            $collection->add(new Attribute('aoRules', $rules, Attribute::TYPE_ARRAY));
        }
    }