<commit_before><?php

namespace Concrete\Core\Entity\Site;

use Concrete\Core\Attribute\Key\SiteKey;
use Concrete\Core\Attribute\ObjectInterface;
use Concrete\Core\Attribute\ObjectTrait;
use Concrete\Core\Entity\Attribute\Value\SiteValue;
use Concrete\Core\Permission\ObjectInterface as PermissionObjectInterface;
use Concrete\Core\Site\Config\Liaison;
use Concrete\Core\Site\Tree\TreeInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="Sites")
 */
class Site implements TreeInterface, ObjectInterface, PermissionObjectInterface
{
    use ObjectTrait;

    /**
     * The site configuration repository.
     *
     * @var \Concrete\Core\Site\Config\Liaison
     */
    protected $siteConfig;

    /**
     * The site identifier.
     *
     * @ORM\Id @ORM\Column(type="integer", options={"unsigned":true})
     * @ORM\GeneratedValue(strategy="AUTO")
     *
     * @var int
     */
    protected $siteID;

    /**
     * The ID of the theme.
     *
     * @ORM\Column(type="integer", options={"unsigned":true})
     *
     * @var int
     */
    protected $pThemeID = 0;

    /**
     * Is this the default site?
     *
     * @ORM\Column(type="boolean")
     *
     * @var bool
     */
    protected $siteIsDefault = false;

    /**
     * The site handle.
     *
     * @ORM\Column(type="string", unique=true)
     *
     * @var string
     */
    protected $siteHandle;

    /**
     * The language sections of this site.
     *
     * @ORM\OneToMany(targetEntity="Locale", cascade={"all"}, mappedBy="site")
     * @ORM\JoinColumn(name="siteLocaleID", referencedColumnName="siteLocaleID")
     *
     * @var \Concrete\Core\Entity\Site\Locale[]|\Doctrine\Common\Collections\ArrayCollection
     **/
    protected $locales;

    /**
     * The site type.
     *
     * @ORM\ManyToOne(targetEntity="Type", inversedBy="sites")
     * @ORM\JoinColumn(name="siteTypeID", referencedColumnName="siteTypeID")
     *
     * @var \Concrete\Core\Entity\Site\Type|null
     */
    protected $type;

    /**
     * Initialize the instance.
     *
     * @param \Concrete\Core\Config\Repository\Repository $appConfigRepository The site configuration repository
     */
    public function __construct($appConfigRepository)
    {
        $this->updateSiteConfigRepository($appConfigRepository);
        $this->locales = new ArrayCollection();
    }

    /**
     * {@inheritdoc}
     *
     * @see \Concrete\Core\Permission\ObjectInterface::getPermissionObjectIdentifier()
     *
     * @return int
     */
    public function getPermissionObjectIdentifier()
    {
        return $this->siteID;
    }

    /**
     * {@inheritdoc}
     *
     * @see \Concrete\Core\Permission\ObjectInterface::getPermissionResponseClassName()
     *
     * @return string
     */
    public function getPermissionResponseClassName()
    {
        return '\\Concrete\\Core\\Permission\\Response\\SiteResponse';
    }

    /**
     * {@inheritdoc}
     *
     * @see \Concrete\Core\Permission\ObjectInterface::getPermissionAssignmentClassName()
     *
     * @return false
     */
    public function getPermissionAssignmentClassName()
    {
        return false;
    }

    /**
     * {@inheritdoc}
     *
     * @see \Concrete\Core\Permission\ObjectInterface::getPermissionObjectKeyCategoryHandle()
     *
     * @return false
     */
    public function getPermissionObjectKeyCategoryHandle()
    {
        return false;
    }

    /**
     * {@inheritdoc}
     *
     * @see \Concrete\Core\Attribute\ObjectInterface::getObjectAttributeCategory()
     *
     * @return \Concrete\Core\Attribute\Category\SiteCategory
     */
    public function getObjectAttributeCategory()
    {
        return \Core::make('\Concrete\Core\Attribute\Category\SiteCategory');
    }

    /**
     * {@inheritdoc}
     *
     * @see \Concrete\Core\Attribute\ObjectInterface::getAttributeValueObject()
     *
     * @return \Concrete\Core\Entity\Attribute\Value\SiteValue|null
     */
    public function getAttributeValueObject($ak, $createIfNotExists = false)
    {
        if (!is_object($ak)) {
            $ak = SiteKey::getByHandle($ak);
        }<commit_msg>Use the ::class syntax for class names<commit_after><?php

namespace Concrete\Core\Entity\Site;

use Concrete\Core\Attribute\Category\SiteCategory;
use Concrete\Core\Attribute\Key\SiteKey;
use Concrete\Core\Attribute\ObjectInterface;
use Concrete\Core\Attribute\ObjectTrait;
use Concrete\Core\Entity\Attribute\Value\SiteValue;
use Concrete\Core\Permission\ObjectInterface as PermissionObjectInterface;
use Concrete\Core\Permission\Response\SiteResponse;
use Concrete\Core\Site\Config\Liaison;
use Concrete\Core\Site\Tree\TreeInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="Sites")
 */
class Site implements TreeInterface, ObjectInterface, PermissionObjectInterface
{
    use ObjectTrait;

    /**
     * The site configuration repository.
     *
     * @var \Concrete\Core\Site\Config\Liaison
     */
    protected $siteConfig;

    /**
     * The site identifier.
     *
     * @ORM\Id @ORM\Column(type="integer", options={"unsigned":true})
     * @ORM\GeneratedValue(strategy="AUTO")
     *
     * @var int
     */
    protected $siteID;

    /**
     * The ID of the theme.
     *
     * @ORM\Column(type="integer", options={"unsigned":true})
     *
     * @var int
     */
    protected $pThemeID = 0;

    /**
     * Is this the default site?
     *
     * @ORM\Column(type="boolean")
     *
     * @var bool
     */
    protected $siteIsDefault = false;

    /**
     * The site handle.
     *
     * @ORM\Column(type="string", unique=true)
     *
     * @var string
     */
    protected $siteHandle;

    /**
     * The language sections of this site.
     *
     * @ORM\OneToMany(targetEntity="Locale", cascade={"all"}, mappedBy="site")
     * @ORM\JoinColumn(name="siteLocaleID", referencedColumnName="siteLocaleID")
     *
     * @var \Concrete\Core\Entity\Site\Locale[]|\Doctrine\Common\Collections\ArrayCollection
     **/
    protected $locales;

    /**
     * The site type.
     *
     * @ORM\ManyToOne(targetEntity="Type", inversedBy="sites")
     * @ORM\JoinColumn(name="siteTypeID", referencedColumnName="siteTypeID")
     *
     * @var \Concrete\Core\Entity\Site\Type|null
     */
    protected $type;

    /**
     * Initialize the instance.
     *
     * @param \Concrete\Core\Config\Repository\Repository $appConfigRepository The site configuration repository
     */
    public function __construct($appConfigRepository)
    {
        $this->updateSiteConfigRepository($appConfigRepository);
        $this->locales = new ArrayCollection();
    }

    /**
     * {@inheritdoc}
     *
     * @see \Concrete\Core\Permission\ObjectInterface::getPermissionObjectIdentifier()
     *
     * @return int
     */
    public function getPermissionObjectIdentifier()
    {
        return $this->siteID;
    }

    /**
     * {@inheritdoc}
     *
     * @see \Concrete\Core\Permission\ObjectInterface::getPermissionResponseClassName()
     *
     * @return string
     */
    public function getPermissionResponseClassName()
    {
        return SiteResponse::class;
    }

    /**
     * {@inheritdoc}
     *
     * @see \Concrete\Core\Permission\ObjectInterface::getPermissionAssignmentClassName()
     *
     * @return false
     */
    public function getPermissionAssignmentClassName()
    {
        return false;
    }

    /**
     * {@inheritdoc}
     *
     * @see \Concrete\Core\Permission\ObjectInterface::getPermissionObjectKeyCategoryHandle()
     *
     * @return false
     */
    public function getPermissionObjectKeyCategoryHandle()
    {
        return false;
    }

    /**
     * {@inheritdoc}
     *
     * @see \Concrete\Core\Attribute\ObjectInterface::getObjectAttributeCategory()
     *
     * @return \Concrete\Core\Attribute\Category\SiteCategory
     */
    public function getObjectAttributeCategory()
    {
        return \Core::make(SiteCategory::class);
    }

    /**
     * {@inheritdoc}
     *
     * @see \Concrete\Core\Attribute\ObjectInterface::getAttributeValueObject()
     *
     * @return \Concrete\Core\Entity\Attribute\Value\SiteValue|null
     */
    public function getAttributeValueObject($ak, $createIfNotExists = false)
    {
        if (!is_object($ak)) {
            $ak = SiteKey::getByHandle($ak);
        }
{'fraction_non_alphanumeric': 0.13144817794604827, 'fraction_numerical': 0.000236630383341221, 'mean_word_length': 2.6310137457044673, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 9, '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': '4019660', 'n_tokens_mistral': 2498, 'n_tokens_neox': 2461, 'n_words': 396}