Code Duplication    Length = 16-16 lines in 3 locations

src/API/MaterialApi.php 2 locations

@@ 118-133 (lines=16) @@
115
     *
116
     * @return array.
117
     */
118
    public function get($media_id)
119
    {
120
        if (!is_string($media_id)) {
121
            $this->setError('参数错误,媒体ID参数错误');
122
123
            return false;
124
        }
125
126
        $queryStr = [
127
            'media_id' => $media_id,
128
        ];
129
130
        $res = $this->_post('get_material', $queryStr);
131
132
        return $res;
133
    }
134
135
    /**
136
     *   删除永久素材.
@@ 142-157 (lines=16) @@
139
     *
140
     * @return bool.  成功返回ok
141
     */
142
    public function del($media_id)
143
    {
144
        if (!is_string($media_id)) {
145
            $this->setError('参数错误,媒体ID参数错误');
146
147
            return false;
148
        }
149
150
        $queryStr = [
151
            "media_id" => $media_id,
152
        ];
153
154
        $res = $this->_post('del_material', $queryStr);
155
156
        return $res;
157
    }
158
159
    /**
160
     *   修改永久素材.

src/API/TemplateApi.php 1 location

@@ 44-59 (lines=16) @@
41
     *
42
     * @return bool|array
43
     */
44
    public function apiAddTemplate($template_id_short)
45
    {
46
        if (!is_string($template_id_short)) {
47
            $this->setError('参数错误');
48
49
            return false;
50
        }
51
52
        $queryStr = [
53
            'template_id_short' => $template_id_short,
54
        ];
55
56
        $res = $this->_post('api_add_template', $queryStr);
57
58
        return $res;
59
    }
60
61
    /**
62
     * 发送模板消息