<commit_before><?php

namespace LumengPHP\Http\Result;

/**
 * 结果
 *
 * @author zhengluming <<EMAIL>>
 */
class Result {

    /**
     * @var int 结果状态
     */
    private $status;

    /**
     * @var string 消息
     */
    private $msg;

    /**
     * @var array (携带的)数据
     */
    private $data;

    public function __construct($status, $msg = '', array $data = []) {
        $this->status = $status;
        $this->msg = $msg;
        $this->data = $data;
    }

    public function getStatus() {
        return $this->status;
    }

    public function getMsg() {
        return $this->msg;
    }

    public function getData() {
        return $this->data;
    }

    public function setStatus($status) {
        $this->status = $status;
    }

    public function setMsg($msg) {
        $this->msg = $msg;
    }

    public function setData(array $data) {
        $this->data = $data;
    }

    public function __toString() {
        return json_encode([
            'status' => $this->status,
            'msg' => $this->msg,
            'data' => $this->data,
        ]);
    }

}
<commit_msg>Result对象增加more属性<commit_after><?php

namespace LumengPHP\Http\Result;

/**
 * 结果
 *
 * @author zhengluming <<EMAIL>>
 */
class Result {

    /**
     * @var int 结果状态
     */
    private $status;

    /**
     * @var string 消息
     */
    private $msg;

    /**
     * @var array (携带的)数据。这个数据是比较正式的数据。
     */
    private $data;

    /**
     * @var array 更多数据。用于携带除了正式数据之外的数据，如调试信息等。
     */
    private $more;

    public function __construct($status, $msg = '', array $data = []) {
        $this->status = $status;
        $this->msg = $msg;
        $this->data = $data;
        $this->more = [];
    }

    public function getStatus() {
        return $this->status;
    }

    public function getMsg() {
        return $this->msg;
    }

    public function getData() {
        return $this->data;
    }

    public function getMore() {
        return $this->more;
    }

    public function setStatus($status) {
        $this->status = $status;
    }

    public function setMsg($msg) {
        $this->msg = $msg;
    }

    public function setData(array $data) {
        $this->data = $data;
    }

    public function setMore(array $more) {
        $this->more = $more;
    }

    /**
     * 返回字符串形式的Result对象，子类可以覆盖此方法用以定制特定的字符串格式。
     * 
     * @return string
     */
    public function __toString() {
        $result = [
            'status' => $this->status,
            'msg' => $this->msg,
            'data' => $this->data,
        ];
        if ($this->more) {
            $result['more'] = $this->more;
        }

        return json_encode($result);
    }

}

{'fraction_non_alphanumeric': 0.15740395374860128, 'fraction_numerical': 0.0, 'mean_word_length': 1.709090909090909, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 42, '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': '393241', 'n_tokens_mistral': 947, 'n_tokens_neox': 938, 'n_words': 181}