<commit_before><?php namespace NukaCode\Menu;

use Illuminate\Support\Collection;
use NukaCode\Menu\Traits\Activate;
use NukaCode\Menu\Traits\Insertable;
use NukaCode\Menu\Traits\Linkable;

/**
 * Class DropDown
 *
 * @package NukaCode\Menu
 */
class DropDown {
    use Linkable;
    use Activate;
    use Insertable;

    /**
     * @var string
     */
    public $slug;

    /**
     * @var string|null
     */
    public $name;


    /**
     * Construct a menu
     *
     * @param $dropDownName The name of the drop down
     */
    public function __construct($dropDownName = null)
    {
        $this->links = new Collection();

        if (isset($dropDownName)) {
            $this->name = $dropDownName;
        }
    }

    /**
     * Check if the current object is a drop down
     *
     * @return bool
     */
    public function isDropDown()
    {
        return true;
    }

    /**
     * Check if the dropdown has links
     *
     * @return bool
     */
    public function hasLinks()
    {
        return (count($this->links) > 0);
    }
}<commit_msg>Adding method to stop activating when links do<commit_after><?php namespace NukaCode\Menu;

use Illuminate\Support\Collection;
use NukaCode\Menu\Traits\Activate;
use NukaCode\Menu\Traits\Insertable;
use NukaCode\Menu\Traits\Linkable;

/**
 * Class DropDown
 *
 * @package NukaCode\Menu
 */
class DropDown {
    use Linkable;
    use Activate;
    use Insertable;

    /**
     * @var string
     */
    public $slug;

    /**
     * @var string|null
     */
    public $name;

    /**
     * @var bool
     */
    public $activateWithLink = true;

    /**
     * Construct a menu
     *
     * @param $dropDownName The name of the drop down
     */
    public function __construct($dropDownName = null)
    {
        $this->links = new Collection();

        if (isset($dropDownName)) {
            $this->name = $dropDownName;
        }
    }

    /**
     * Check if the current object is a drop down
     *
     * @return bool
     */
    public function isDropDown()
    {
        return true;
    }

    /**
     * Check if the dropdown has links
     *
     * @return bool
     */
    public function hasLinks()
    {
        return (count($this->links) > 0);
    }

    /**
     * This stops the drop down from becoming active
     * because a child link is active.
     */
    public function disableActiveParentage()
    {
        $this->activateWithLink = false;
    }
}
{'fraction_non_alphanumeric': 0.11551020408163265, 'fraction_numerical': 0.0008163265306122449, 'mean_word_length': 1.8869257950530036, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2622100', 'n_tokens_mistral': 768, 'n_tokens_neox': 753, 'n_words': 197}