| Conditions | 2 |
| Paths | 2 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function assembly(Rocket $rocket, Closure $next): Rocket |
||
| 26 | { |
||
| 27 | /* @var Rocket $rocket */ |
||
| 28 | $rocket = $next($rocket); |
||
| 29 | |||
| 30 | Logger::info('[unipay][LaunchPlugin] 插件开始装载', ['rocket' => $rocket]); |
||
| 31 | |||
| 32 | if (should_do_http_request($rocket->getDirection())) { |
||
| 33 | $response = Collection::wrap($rocket->getDestination()); |
||
| 34 | $signature = $response->get('signature'); |
||
| 35 | $response->forget('signature'); |
||
| 36 | |||
| 37 | verify_unipay_sign( |
||
| 38 | $rocket->getParams(), $response->sortKeys()->toString(), $signature |
||
| 39 | ); |
||
| 40 | |||
| 41 | $rocket->setDestination($response); |
||
| 42 | } |
||
| 43 | |||
| 44 | Logger::info('[unipay][LaunchPlugin] 插件装载完毕', ['rocket' => $rocket]); |
||
| 45 | |||
| 46 | return $rocket; |
||
| 47 | } |
||
| 49 |