Passed
Pull Request — master (#501)
by Songda
04:17 queued 02:13
created

CreatePlugin::getUri()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yansongda\Pay\Plugin\Wechat\Fund\Transfer;
6
7
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
8
use Yansongda\Pay\Rocket;
9
10
class CreatePlugin extends GeneralPlugin
11
{
12
    /**
13
     * @throws \Yansongda\Pay\Exception\ContainerDependencyException
14
     * @throws \Yansongda\Pay\Exception\ContainerException
15
     * @throws \Yansongda\Pay\Exception\ServiceNotFoundException
16
     */
17
    protected function doSomething(Rocket $rocket): void
18
    {
19
        $config = get_wechat_config($rocket->getParams());
20
21
        $wechatId = [
22
            'appid' => $config->get('mp_app_id'),
23
        ];
24
25
        $rocket->mergePayload($wechatId);
26
    }
27
28
    protected function getUri(Rocket $rocket): string
29
    {
30
        return 'v3/transfer/batches';
31
    }
32
}
33