<commit_before><?php

namespace CS\SettingsBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

/**
 * @ORM\Table(name="config_sections")
 * @ORM\Entity(repositoryClass="CS\SettingsBundle\Repository\SectionRepository")
 * @UniqueEntity("name")
 */
class Section
{
    /**
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\Column(name="name", type="string", length=125, nullable=false, unique=true)
     */
    private $name;

    /**
    * @ORM\ManyToOne(targetEntity="Section", inversedBy="children")
    */
    private $parent;

    /**
    * @ORM\OneToMany(targetEntity="Section", mappedBy="parent")
    */
    private $children;

    /**
     * @ORM\OneToMany(targetEntity="Setting", mappedBy="section")
     * @var ArrayCollection
     */
    private $settings;

    public function __construct()
    {
        $this->children = new ArrayCollection;
        $this->settings = new ArrayCollection;
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set name
     *
     * @param  string  $name
     * @return Section
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get parent
     *
     * @return Section
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Set parent
     *
     * @param self $parent
     * @return Section
     */
    public function setParent(self $parent)
    {
        $this->parent = $parent;

        return $this;
    }

    /**
     * Get children
     *
     * @return ArrayCollection
     */
    public function getChildren()
    {
        return $this->children;
    }

    /**
     * Add child
     *
     * @param self $child
     * @return Section
     */
    public function addChild(self $child)
    {
        $this->children[] = $child;
        $child->setParent($this);

        return $this;
    }

    /**
     * Remove child
     *
     * @param self $child
     * @return Section
     */
    public function removeChild(self $child)
    {
        $this->children->removeElement($child);

        return $this;
    }

    /**
     * Get settings
     *
     * @return ArrayCollection
     */
    public function getSettings()
    {
        return $this->settings;
    }

    /**
     * Add a setting
     * @param Setting $setting
     * @return Section
     */
    public function addSetting(Setting $setting)
    {
        $this->settings[] = $setting;
        $setting->setSection($this);<commit_msg>Changed signature of Section entity methods<commit_after><?php

namespace CS\SettingsBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

/**
 * @ORM\Table(name="config_sections")
 * @ORM\Entity(repositoryClass="CS\SettingsBundle\Repository\SectionRepository")
 * @UniqueEntity("name")
 */
class Section
{
    /**
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\Column(name="name", type="string", length=125, nullable=false, unique=true)
     */
    private $name;

    /**
    * @ORM\ManyToOne(targetEntity="Section", inversedBy="children")
    */
    private $parent;

    /**
    * @ORM\OneToMany(targetEntity="Section", mappedBy="parent")
    */
    private $children;

    /**
     * @ORM\OneToMany(targetEntity="Setting", mappedBy="section")
     * @var ArrayCollection
     */
    private $settings;

    public function __construct()
    {
        $this->children = new ArrayCollection;
        $this->settings = new ArrayCollection;
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set name
     *
     * @param  string  $name
     * @return Section
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get parent
     *
     * @return Section
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Set parent
     *
     * @param Section $parent
     * @return Section
     */
    public function setParent(Section $parent)
    {
        $this->parent = $parent;

        return $this;
    }

    /**
     * Get children
     *
     * @return ArrayCollection
     */
    public function getChildren()
    {
        return $this->children;
    }

    /**
     * Add child
     *
     * @param Section $child
     * @return Section
     */
    public function addChild(Section $child)
    {
        $this->children[] = $child;
        $child->setParent($this);

        return $this;
    }

    /**
     * Remove child
     *
     * @param Section $child
     * @return Section
     */
    public function removeChild(Section $child)
    {
        $this->children->removeElement($child);

        return $this;
    }

    /**
     * Get settings
     *
     * @return ArrayCollection
     */
    public function getSettings()
    {
        return $this->settings;
    }

    /**
     * Add a setting
     * @param Setting $setting
     * @return Section
     */
    public function addSetting(Setting $setting)
    {
        $this->settings[] = $setting;
        $setting->setSection($this);
{'fraction_non_alphanumeric': 0.13876576883736788, 'fraction_numerical': 0.0010228435049437436, 'mean_word_length': 1.9044554455445544, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '3856863', 'n_tokens_mistral': 1784, 'n_tokens_neox': 1741, 'n_words': 346}