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

GeneralPayPlugin::assembly()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 2
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