Code Duplication    Length = 9-10 lines in 4 locations

src/OfficialAccount/Semantic/Client.php 1 location

@@ 32-41 (lines=10) @@
29
     *
30
     * @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
31
     */
32
    public function query(string $keyword, string $categories, array $optional = [])
33
    {
34
        $params = [
35
            'query' => $keyword,
36
            'category' => $categories,
37
            'appid' => $this->app['config']['app_id'],
38
        ];
39
40
        return $this->httpPostJson('semantic/semproxy/search', array_merge($params, $optional));
41
    }
42
}
43

src/Payment/Redpack/Client.php 1 location

@@ 31-39 (lines=9) @@
28
     *
29
     * @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
30
     */
31
    public function info(array $params)
32
    {
33
        $base = [
34
            'appid' => $this->app['config']->app_id,
35
            'bill_type' => 'MCHT',
36
        ];
37
38
        return $this->safeRequest('mmpaymkttransfers/gethbinfo', array_merge($base, $params));
39
    }
40
41
    /**
42
     * Send normal redpack.

src/Payment/Transfer/Client.php 2 locations

@@ 30-38 (lines=9) @@
27
     *
28
     * @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
29
     */
30
    public function info(array $params)
31
    {
32
        $base = [
33
            'appid' => $this->app['config']->app_id,
34
            'mch_id' => $this->app['config']->mch_id,
35
        ];
36
37
        return $this->safeRequest('mmpaymkttransfers/gettransferinfo', array_merge($base, $params));
38
    }
39
40
    /**
41
     * Send MerchantPay.
@@ 47-55 (lines=9) @@
44
     *
45
     * @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
46
     */
47
    public function send(array $params)
48
    {
49
        $base = [
50
            'mchid' => $this->app['config']->mch_id,
51
            'mch_appid' => $this->app['config']->app_id,
52
        ];
53
54
        return $this->safeRequest('mmpaymkttransfers/promotion/transfers', array_merge($base, $params));
55
    }
56
}
57