<commit_before><?php

namespace OpenOrchestra\DisplayBundle\Manager;

use OpenOrchestra\BaseBundle\Context\CurrentSiteIdInterface;
use Symfony\Component\HttpFoundation\RequestStack;

/**
 * Class SiteManager
 */
class SiteManager implements CurrentSiteIdInterface
{
    protected $siteId;
    protected $requestStack;
    protected $currentLanguage;

    /**
     * @param RequestStack $requestStack
     */
    public function __construct(RequestStack $requestStack)
    {
        $this->requestStack = $requestStack;
    }

    /**
     * @return string
     */
    public function getCurrentSiteId()
    {
        if (is_null($this->siteId)) {
            $this->siteId = $this->requestStack->getMasterRequest()->get('siteId');
        }

        return $this->siteId;
    }

    /**
     * @param string $siteId
     */
    public function setSiteId($siteId)
    {
        $this->siteId = $siteId;
    }

    /**
     * Get the current default language of the current site
     * Return false if current site is off
     *
     * @return string|false
     */
    public function getCurrentSiteDefaultLanguage()
    {
        if (is_null($this->currentLanguage) && ($request = $this->requestStack->getMasterRequest())) {
            $this->currentLanguage = $request->get('language', $request->getLocale());
        }

        return $this->currentLanguage;
    }

    /**
     * @param string $currentLanguage
     */
    public function setCurrentLanguage($currentLanguage)
    {
        $this->currentLanguage = $currentLanguage;
    }
}
<commit_msg>Update SiteManager.php<commit_after><?php

namespace OpenOrchestra\DisplayBundle\Manager;

use OpenOrchestra\BaseBundle\Context\CurrentSiteIdInterface;
use Symfony\Component\HttpFoundation\RequestStack;

/**
 * Class SiteManager
 */
class SiteManager implements CurrentSiteIdInterface
{
    protected $siteId;
    protected $requestStack;
    protected $currentLanguage;

    /**
     * @param RequestStack $requestStack
     */
    public function __construct(RequestStack $requestStack)
    {
        $this->requestStack = $requestStack;
    }

    /**
     * @return string
     */
    public function getCurrentSiteId()
    {
        if (is_null($this->siteId)) {
            $this->siteId = $this->requestStack->getMasterRequest()->get('siteId');
        }

        return $this->siteId;
    }

    /**
     * @param string $siteId
     */
    public function setSiteId($siteId)
    {
        $this->siteId = $siteId;
    }

    /**
     * Get the current default language of the current site
     * Return false if current site is off
     *
     * @return string
     */
    public function getCurrentSiteDefaultLanguage()
    {
        if (is_null($this->currentLanguage) && ($request = $this->requestStack->getMasterRequest())) {
            $this->currentLanguage = $request->get('language', $request->getLocale());
        }

        return $this->currentLanguage;
    }

    /**
     * @param string $currentLanguage
     */
    public function setCurrentLanguage($currentLanguage)
    {
        $this->currentLanguage = $currentLanguage;
    }
}

{'fraction_non_alphanumeric': 0.12070626003210273, 'fraction_numerical': 0.0, 'mean_word_length': 2.6106604866743917, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '3088509', 'n_tokens_mistral': 863, 'n_tokens_neox': 854, 'n_words': 171}