protected function prepareEvent(EventInterface $event)
    {
        foreach (['elementSpec', 'inputSpec'] as $type) {
            if (! $event->getParam($type)) {
                $event->setParam($type, new ArrayObject());
            }
        }

        $elementSpec = $event->getParam('elementSpec');
        $inputSpec   = $event->getParam('inputSpec');

        if (! isset($elementSpec['spec'])) {
            $elementSpec['spec'] = [];
        }
        if (! isset($inputSpec['filters'])) {
            $inputSpec['filters'] = [];
        }
        if (! isset($inputSpec['validators'])) {
            $inputSpec['validators'] = [];
        }
    }