Passed
Pull Request — master (#909)
by Songda
02:02
created

StartPlugin::assembly()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 9
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yansongda\Pay\Plugin\Wechat;
6
7
use Closure;
8
use Yansongda\Pay\Contract\PluginInterface;
9
use Yansongda\Pay\Logger;
10
use Yansongda\Pay\Rocket;
11
12
class StartPlugin implements PluginInterface
13
{
14
    public function assembly(Rocket $rocket, Closure $next): Rocket
15
    {
16
        Logger::debug('[Wechat][StartPlugin] 插件开始装载', ['rocket' => $rocket]);
17
18
        $rocket->mergePayload($rocket->getParams());
19
20
        Logger::info('[Wechat][StartPlugin] 插件装载完毕', ['rocket' => $rocket]);
21
22
        return $next($rocket);
23
    }
24
}
25