<commit_before><?php

class CM_AdproviderAdapter_Epom extends CM_AdproviderAdapter_Abstract {

    public function getHtml($zoneData, array $variables) {
        $zoneId = CM_Util::htmlspecialchars($zoneData['zoneId']);
        $variables = $this->_variableKeysToUnderscore($variables);
        $variables['key'] = '<KEY>';

        $html = '<div id="epom-' . $zoneId . '" class="epom-ad" data-zone-id="' . $zoneId . '" data-variables="' .
            CM_Util::htmlspecialchars(json_encode($variables, JSON_FORCE_OBJECT)) . '"></div>';
        return $html;
    }

    private function _variableKeysToUnderscore($variables) {
        foreach ($variables as $key => $value) {
            unset ($variables[$key]);
            $underscoreKey = str_replace('-', '_', $key);
            $variables[$underscoreKey] = $value;
        }
        return $variables;
    }
}<commit_msg>Move epom key to config.<commit_after><?php

class CM_AdproviderAdapter_Epom extends CM_AdproviderAdapter_Abstract {

    /**
     * @return string
     */
    private function _getAccessKey() {
        return self::_getConfig()->accessKey;
    }

    public function getHtml($zoneData, array $variables) {
        $zoneId = CM_Util::htmlspecialchars($zoneData['zoneId']);
        $variables = $this->_variableKeysToUnderscore($variables);
        $variables['key'] = $this->_getAccessKey();

        $html = '<div id="epom-' . $zoneId . '" class="epom-ad" data-zone-id="' . $zoneId . '" data-variables="' .
            CM_Util::htmlspecialchars(json_encode($variables, JSON_FORCE_OBJECT)) . '"></div>';
        return $html;
    }

    private function _variableKeysToUnderscore($variables) {
        foreach ($variables as $key => $value) {
            unset ($variables[$key]);
            $underscoreKey = str_replace('-', '_', $key);
            $variables[$underscoreKey] = $value;
        }
        return $variables;
    }
}
{'fraction_non_alphanumeric': 0.15723270440251572, 'fraction_numerical': 0.0, 'mean_word_length': 2.9523809523809526, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 14, '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': '7375335', 'n_tokens_mistral': 569, 'n_tokens_neox': 553, 'n_words': 103}