protected function modifyBitmaskValue($value, $toggle, $attribute) { $bit = $this->getBitForAttribute($attribute); if ($toggle) { $value = (int) $value + (int) $bit; } else { $value = (int) $value - (int) $bit; } return $value; }