<commit_before><?php

namespace Rekurzia\Log;

use yii\base\InvalidConfigException;
use yii\log\Logger;
use yii\log\Target;

class SentryTarget extends Target
{
    /**
     * @var string Raven-compatible DSN
     */
    public $dsn;

    /**
     * @var array options to be passed to Raven Client
     */
    public $options = [];

    /**
     * @var boolean whether to include context message
     */
    public $includeContextMessage = false;

    private $_client;

    /**
     * @inheritdoc
     */
    public function init()
    {
        parent::init();
        if ($this->dsn === null) {
            throw new InvalidConfigException('The "dsn" property must be set.');
        }
    }

    /**
     * Gets Raven Client instance.
     * @return \Raven_Client
     */
    public function getClient()
    {
        if ($this->_client === null) {
            $this->_client = new \Raven_Client($this->dsn, $this->options);
        }

        return $this->_client;
    }

    /**
     * Sends log message to Sentry instance.
     */
    public function export()
    {
        foreach ($this->messages as $message) {
            $options = [
                'level' => Logger::getLevelName($message[1]),
            ];

            $logMessage = $this->formatMessage($message);

            $text = $message[0];
            if (!is_string($text) && $text instanceof \Exception) {
                $logMessage = $text->getMessage() . "\n\n" . $logMessage;
            }

            $this->getClient()->captureMessage($logMessage, [], $options);
        }
    }

    /**
     * Ability to hide context message. See parent implementation for more details.
     * @return string
     */
    protected function getContextMessage()
    {
        return $this->includeContextMessage ? parent::getContextMessage() : '';
    }
}<commit_msg>Update internal variable name<commit_after><?php

namespace Rekurzia\Log;

use yii\base\InvalidConfigException;
use yii\log\Logger;
use yii\log\Target;

class SentryTarget extends Target
{
    /**
     * @var string Raven-compatible DSN
     */
    public $dsn;

    /**
     * @var array options to be passed to Raven Client
     */
    public $options = [];

    /**
     * @var boolean whether to include context message
     */
    public $includeContextMessage = false;

    private $_client;

    /**
     * @inheritdoc
     */
    public function init()
    {
        parent::init();
        if ($this->dsn === null) {
            throw new InvalidConfigException('The "dsn" property must be set.');
        }
    }

    /**
     * Gets Raven Client instance.
     * @return \Raven_Client
     */
    public function getClient()
    {
        if ($this->_client === null) {
            $this->_client = new \Raven_Client($this->dsn, $this->options);
        }

        return $this->_client;
    }

    /**
     * Sends log message to Sentry instance.
     */
    public function export()
    {
        foreach ($this->messages as $message) {
            $data = [
                'level' => Logger::getLevelName($message[1]),
            ];

            $logMessage = $this->formatMessage($message);

            $text = $message[0];
            if (!is_string($text) && $text instanceof \Exception) {
                $logMessage = $text->getMessage() . "\n\n" . $logMessage;
            }

            $this->getClient()->captureMessage($logMessage, [], $data);
        }
    }

    /**
     * Ability to hide context message. See parent implementation for more details.
     * @return string
     */
    protected function getContextMessage()
    {
        return $this->includeContextMessage ? parent::getContextMessage() : '';
    }
}
{'fraction_non_alphanumeric': 0.13525258011950028, 'fraction_numerical': 0.0010863661053775121, 'mean_word_length': 1.9137658227848102, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '6867467', 'n_tokens_mistral': 1048, 'n_tokens_neox': 1020, 'n_words': 255}