Passed
Push — master ( 2729ea...b493c9 )
by Songda
02:00
created

QueryComplaintsPlugin   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 1
b 0
f 0
dl 0
loc 15
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A doSomething() 0 3 1
A getUri() 0 3 1
A getMethod() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yansongda\Pay\Plugin\Wechat\Risk\Complaints;
6
7
use Yansongda\Pay\Plugin\Wechat\GeneralPlugin;
8
use Yansongda\Pay\Rocket;
9
10
/**
11
 * @see https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter10_2_11.shtml
12
 */
13
class QueryComplaintsPlugin extends GeneralPlugin
14
{
15
    protected function getMethod(): string
16
    {
17
        return 'GET';
18
    }
19
20
    protected function doSomething(Rocket $rocket): void
21
    {
22
        $rocket->setPayload(null);
23
    }
24
25
    protected function getUri(Rocket $rocket): string
26
    {
27
        return 'v3/merchant-service/complaints-v2?'.$rocket->getPayload()->query();
28
    }
29
}
30