public function createFilter($name, $type = null, array $options = [])
    {
        $this->preventIfLocked();

        if (null !== $type) {
            return $this->getFactory()->createFilterBuilder($name, $type, $options);
        }

        throw new \InvalidArgumentException('Filter type guessing is not yet supported.');
        // TODO return $this->getFormFactory()->createFilterBuilderForProperty($this->getDataClass(), $name, $options);
    }