public function setVisibility($visibility)
    {
        switch ($visibility) {
            case Modifiers::VISIBILITY_PUBLIC:
                $this->removeModifier(Modifiers::MODIFIER_PRIVATE | Modifiers::MODIFIER_PROTECTED);
                $this->addModifier(Modifiers::MODIFIER_PUBLIC);
                break;
            case Modifiers::VISIBILITY_PROTECTED:
                $this->removeModifier(Modifiers::MODIFIER_PRIVATE | Modifiers::MODIFIER_PUBLIC);
                $this->addModifier(Modifiers::MODIFIER_PROTECTED);
                break;
            case Modifiers::VISIBILITY_PRIVATE:
                $this->removeModifier(Modifiers::MODIFIER_PUBLIC | Modifiers::MODIFIER_PROTECTED);
                $this->addModifier(Modifiers::MODIFIER_PRIVATE);
                break;
            default:
                throw new InvalidArgumentException('Unknown visibility to set.');
        }
    }