Completed
Push — master ( 56c44b...57c31b )
by Songda
05:33 queued 11s
created

GeneralPlugin   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A assembly() 0 9 1
getMethod() 0 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 GeneralPlugin 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