init
- 框架初始化 - 安装插件 - 修复PHP8.4报错
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yansongda\Pay\Direction;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Yansongda\Pay\Contract\DirectionInterface;
|
||||
use Yansongda\Pay\Contract\PackerInterface;
|
||||
use Yansongda\Pay\Exception\Exception;
|
||||
use Yansongda\Pay\Exception\InvalidResponseException;
|
||||
|
||||
class OriginResponseDirection implements DirectionInterface
|
||||
{
|
||||
/**
|
||||
* @throws InvalidResponseException
|
||||
*/
|
||||
public function parse(PackerInterface $packer, ?ResponseInterface $response): ?ResponseInterface
|
||||
{
|
||||
if (!is_null($response)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
throw new InvalidResponseException(Exception::INVALID_RESPONSE_CODE);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user