Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
14 | class ParserPlugin implements PluginInterface |
||
15 | { |
||
16 | /** |
||
17 | * @throws \Yansongda\Pay\Exception\ServiceNotFoundException |
||
18 | * @throws \Yansongda\Pay\Exception\ContainerException |
||
19 | * @throws \Yansongda\Pay\Exception\ContainerDependencyException |
||
20 | * @throws \Yansongda\Pay\Exception\InvalidConfigException |
||
21 | */ |
||
22 | public function assembly(Rocket $rocket, Closure $next): Rocket |
||
23 | { |
||
24 | /* @var Rocket $rocket */ |
||
25 | $rocket = $next($rocket); |
||
26 | |||
27 | $packer = $this->getPacker($rocket); |
||
28 | |||
29 | return $rocket->setDestination($packer->parse($rocket->getDestination())); |
||
|
|||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @throws \Yansongda\Pay\Exception\ContainerDependencyException |
||
34 | * @throws \Yansongda\Pay\Exception\ContainerException |
||
35 | * @throws \Yansongda\Pay\Exception\InvalidConfigException |
||
36 | * @throws \Yansongda\Pay\Exception\ServiceNotFoundException |
||
37 | */ |
||
38 | protected function getPacker(Rocket $rocket): ParserInterface |
||
49 | } |
||
50 | } |
||
51 |