protected function modifyFlagValue($value)
    {
        $this->setDefaultLastValue('groupType', $this->getDefaultEnumValue());
        $flags = $this->getFlagFromLastValue($this->getLastValue());

        if (!in_array($this->flagName, self::SCOPES)) {
            $this->modifyBitmaskValue(
                $flags,
                $this->options['invert'] ? !$value : $value,
                $this->flagName
            );
        } else {
            $this->modifyGroupScopeBit($flags, $value);
        }

        return $flags->getValue();
    }