<commit_before><?php

class CM_I18n_Phrase {

    /** @var $_phrase string */
    protected $_phrase;

    /** @var $_variables string[] */
    protected $_variables;

    /**
     * @param string        $phrase
     * @param string[]|null $variables
     */
    public function __construct($phrase, array $variables = null) {
        $this->_phrase = (string) $phrase;
        if (null === $variables) {
            $variables = [];
        }
        $this->_variables = $variables;
    }

    /**
     * @param CM_Frontend_Render $render
     * @return string
     */
    public function translate(CM_Frontend_Render $render) {
        return $render->getTranslation($this->_phrase, $this->_variables);
    }
}<commit_msg>add empty check to constructor<commit_after><?php

class CM_I18n_Phrase {

    /** @var $_phrase string */
    protected $_phrase;

    /** @var $_variables string[] */
    protected $_variables;

    /**
     * @param string        $phrase
     * @param string[]|null $variables
     * @throws CM_Exception_InvalidParam
     */
    public function __construct($phrase, array $variables = null) {
        $phrase = (string) $phrase;
        if (empty($phrase)) {
            throw new CM_Exception_InvalidParam('I18n phrase should not be empty');
        }
        $this->_phrase = $phrase;
        if (null === $variables) {
            $variables = [];
        }
        $this->_variables = $variables;
    }

    /**
     * @param CM_Frontend_Render $render
     * @return string
     */
    public function translate(CM_Frontend_Render $render) {
        return $render->getTranslation($this->_phrase, $this->_variables);
    }
}
{'fraction_non_alphanumeric': 0.1363910681955341, 'fraction_numerical': 0.003621001810500905, 'mean_word_length': 2.316, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '5078962', 'n_tokens_mistral': 475, 'n_tokens_neox': 462, 'n_words': 110}