for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?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 guide(PackerInterface $packer, ?ResponseInterface $response): ?ResponseInterface
if (!is_null($response)) {
return $response;
}
throw new InvalidResponseException(Exception::INVALID_RESPONSE_CODE);