Passed
Push — master ( 96d02d...d08d15 )
by Songda
02:13 queued 10s
created

GeneralPayPlugin   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 5
c 0
b 0
f 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A assembly() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yansongda\Pay\Plugin\Alipay;
6
7
use Closure;
8
use Yansongda\Pay\Contract\PluginInterface;
9
use Yansongda\Pay\Rocket;
10
11
abstract class GeneralPayPlugin implements PluginInterface
12
{
13
    public function assembly(Rocket $rocket, Closure $next): Rocket
14
    {
15
        $rocket->mergePayload([
16
            'method' => $this->getMethod(),
17
            'biz_content' => $rocket->getParams(),
18
        ]);
19
20
        return $next($rocket);
21
    }
22
23
    abstract protected function getMethod(): string;
24
}
25