<commit_before><?php

namespace Concerto\PanelBundle\Entity;

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

/**
 * @ORM\Table
 * @ORM\Entity(repositoryClass="Concerto\PanelBundle\Repository\TestVariableRepository")
 * @UniqueEntity(fields={"name","type","test"}, message="validate.test.variables.unique")
 */
class TestVariable extends AEntity implements \JsonSerializable
{

    /**
     * @var string
     * @ORM\Column(type="string", length=64)
     * @Assert\Length(min="1", max="64", minMessage="validate.test.variables.name.min", maxMessage="validate.test.variables.name.max")
     * @Assert\NotBlank(message="validate.test.variables.name.blank")
     * @Assert\Regex("/^\.?[a-zA-Z][a-zA-Z0-9_]*(?<!_)$/", message="validate.test.variables.name.incorrect")
     */
    private $name;

    /**
     *
     * @var string
     * @ORM\Column(type="text")
     */
    private $description;

    /**
     *
     * @var string
     * @ORM\Column(type="text", nullable=true)
     */
    private $value;

    /**
     *
     * @var boolean
     * @ORM\Column(type="boolean")
     */
    private $passableThroughUrl;

    /**
     *
     * @var integer
     * @ORM\Column(type="integer")
     */
    private $type;

    /**
     * @ORM\ManyToOne(targetEntity="Test", inversedBy="variables")
     */
    private $test;

    /**
     * @ORM\JoinColumn(name="parentVariable_id", referencedColumnName="id", nullable=true)
     * @ORM\ManyToOne(targetEntity="TestVariable", inversedBy="childVariables")
     */
    private $parentVariable;

    /**
     * @ORM\OneToMany(targetEntity="TestVariable", mappedBy="parentVariable", cascade={"remove"})
     */
    private $childVariables;

    /**
     * @ORM\OneToMany(targetEntity="TestWizardParam", mappedBy="variable", cascade={"remove"})
     */
    private $params;

    /**
     * @ORM\OneToMany(targetEntity="TestNodePort", mappedBy="variable", cascade={"remove"})
     */
    private $ports;

    public function __construct()
    {
        parent::__construct();

        $this->description = "";
        $this->ports = new ArrayCollection();
        $this->params = new ArrayCollection();
    }

    public function getOwner()
    {
        return $this->getTest()->getOwner();
    }

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

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()<commit_msg>added string representation for TestVariable<commit_after><?php

namespace Concerto\PanelBundle\Entity;

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

/**
 * @ORM\Table
 * @ORM\Entity(repositoryClass="Concerto\PanelBundle\Repository\TestVariableRepository")
 * @UniqueEntity(fields={"name","type","test"}, message="validate.test.variables.unique")
 */
class TestVariable extends AEntity implements \JsonSerializable
{

    /**
     * @var string
     * @ORM\Column(type="string", length=64)
     * @Assert\Length(min="1", max="64", minMessage="validate.test.variables.name.min", maxMessage="validate.test.variables.name.max")
     * @Assert\NotBlank(message="validate.test.variables.name.blank")
     * @Assert\Regex("/^\.?[a-zA-Z][a-zA-Z0-9_]*(?<!_)$/", message="validate.test.variables.name.incorrect")
     */
    private $name;

    /**
     *
     * @var string
     * @ORM\Column(type="text")
     */
    private $description;

    /**
     *
     * @var string
     * @ORM\Column(type="text", nullable=true)
     */
    private $value;

    /**
     *
     * @var boolean
     * @ORM\Column(type="boolean")
     */
    private $passableThroughUrl;

    /**
     *
     * @var integer
     * @ORM\Column(type="integer")
     */
    private $type;

    /**
     * @ORM\ManyToOne(targetEntity="Test", inversedBy="variables")
     */
    private $test;

    /**
     * @ORM\JoinColumn(name="parentVariable_id", referencedColumnName="id", nullable=true)
     * @ORM\ManyToOne(targetEntity="TestVariable", inversedBy="childVariables")
     */
    private $parentVariable;

    /**
     * @ORM\OneToMany(targetEntity="TestVariable", mappedBy="parentVariable", cascade={"remove"})
     */
    private $childVariables;

    /**
     * @ORM\OneToMany(targetEntity="TestWizardParam", mappedBy="variable", cascade={"remove"})
     */
    private $params;

    /**
     * @ORM\OneToMany(targetEntity="TestNodePort", mappedBy="variable", cascade={"remove"})
     */
    private $ports;

    public function __construct()
    {
        parent::__construct();

        $this->description = "";
        $this->ports = new ArrayCollection();
        $this->params = new ArrayCollection();
    }

    public function __toString()
    {
        return "TestVariable (name:" . $this->getName() . ")";
    }

    public function getOwner()
    {
        return $this->getTest()->getOwner();
    }

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

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
{'fraction_non_alphanumeric': 0.16539578794480755, 'fraction_numerical': 0.002541757443718228, 'mean_word_length': 2.7966919365954515, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 16, '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': '2973024', 'n_tokens_mistral': 1734, 'n_tokens_neox': 1662, 'n_words': 254}