<commit_before><?php

class CM_Params extends CM_Class_Abstract {

    /**  @var array */
    private $_paramsOriginal = array();

    /**  @var array */
    private $_params = array();

    /** @var bool */
    private $_decode;

    /**
     * @param array|null $params
     * @param bool|null  $decode Defaults to true
     */
    public function __construct(array $params = null, $decode = null) {
        if (null === $decode) {
            $decode = true;
        }
        $this->_decode = (bool) $decode;
        $this->_paramsOriginal = (array) $params;
        $this->_params = (array) $params;
        if ($this->_decode) {
            $this->_params = array();
        }
    }

    /**
     * @param string     $key
     * @param mixed|null $default
     * @return mixed
     */
    public function get($key, $default = null) {
        return $this->_get($key, $default);
    }

    /**
     * @param string $key
     * @param mixed  $value
     */
    public function set($key, $value) {
        if ($this->_decode) {
            $value = self::decode($value);
        }
        $this->_params[$key] = $value;
    }

    /**
     * @param string $key
     * @return bool
     */
    public function has($key) {
        return (array_key_exists($key, $this->_params) && null !== $this->_params[$key])
            || (array_key_exists($key, $this->_paramsOriginal) && null !== $this->_paramsOriginal[$key]);
    }

    /**
     * @return array
     */
    public function getAll() {
        foreach (array_diff_key($this->_paramsOriginal, $this->_params) as $key => $value) {
            $this->_params[$key] = self::decode($value);
        }
        return $this->_params;
    }

    /**
     * @return array
     */
    public function getAllOriginal() {
        return $this->_paramsOriginal;
    }

    /**
     * @param string      $key
     * @param string|null $default
     * @return float
     */
    public function getFloat($key, $default = null) {
        $param = $this->_get($key, $default);
        return $this->_getFloat($param);
    }

    /**
     * @param string      $key
     * @param string|null $default
     * @return string<commit_msg>Check CM_Params->decode flag before getAll.<commit_after><?php

class CM_Params extends CM_Class_Abstract {

    /**  @var array */
    private $_paramsOriginal = array();

    /**  @var array */
    private $_params = array();

    /** @var bool */
    private $_decode;

    /**
     * @param array|null $params
     * @param bool|null  $decode Defaults to true
     */
    public function __construct(array $params = null, $decode = null) {
        if (null === $decode) {
            $decode = true;
        }
        $this->_decode = (bool) $decode;
        $this->_paramsOriginal = (array) $params;
        $this->_params = (array) $params;
        if ($this->_decode) {
            $this->_params = array();
        }
    }

    /**
     * @param string     $key
     * @param mixed|null $default
     * @return mixed
     */
    public function get($key, $default = null) {
        return $this->_get($key, $default);
    }

    /**
     * @param string $key
     * @param mixed  $value
     */
    public function set($key, $value) {
        if ($this->_decode) {
            $value = self::decode($value);
        }
        $this->_params[$key] = $value;
    }

    /**
     * @param string $key
     * @return bool
     */
    public function has($key) {
        return (array_key_exists($key, $this->_params) && null !== $this->_params[$key])
            || (array_key_exists($key, $this->_paramsOriginal) && null !== $this->_paramsOriginal[$key]);
    }

    /**
     * @return array
     */
    public function getAll() {
        if ($this->_decode) {
            foreach (array_diff_key($this->_paramsOriginal, $this->_params) as $key => $value) {
                $this->_params[$key] = self::decode($value);
            }
        }
        return $this->_params;
    }

    /**
     * @return array
     */
    public function getAllOriginal() {
        return $this->_paramsOriginal;
    }

    /**
     * @param string      $key
     * @param string|null $default
     * @return float
     */
    public function getFloat($key, $default = null) {
        $param = $this->_get($key, $default);
        return $this->_getFloat($param);
    }

    /**
     * @param string      $key
     * @param string|null $default
     * @return string
{'fraction_non_alphanumeric': 0.16041572525982828, 'fraction_numerical': 0.0, 'mean_word_length': 1.9201846965699207, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '1164702', 'n_tokens_mistral': 1323, 'n_tokens_neox': 1301, 'n_words': 305}