public function filter($isSet, $value = null, $filterData = null)
    {
        /** @var FilterRule $rule */
        foreach ($this->rules as $rule) {
            $rule->setFilterData($filterData);

            if ($isSet || $rule->allowedNotSet()) {
                $value = $rule->filter($value);
                $isSet = $rule->isNotEmpty();
            }
        }

        return new FilterResult($isSet, $value);
    }