private function createFromToRule(IAttribute $attribute, $formattedValueZero, $formattedValueOne)
    {
        // If something went wrong return an empty list.
        if ($formattedValueZero === false || $formattedValueOne === false) {
            return new StaticIdList([]);
        }

        // Add rule to the filter.
        $rule = $this->buildFromToRule($attribute);

        if (null !== $formattedValueOne) {
            $rule->setLowerBound($formattedValueZero, $this->get('moreequal'))
                ->setUpperBound($formattedValueOne, $this->get('lessequal'));
            return $rule;
        }
        if ($this->get('fromfield')) {
            $rule->setLowerBound($formattedValueZero, $this->get('moreequal'));
            return $rule;
        }
        $rule->setUpperBound($formattedValueZero, $this->get('lessequal'));

        return $rule;
    }