feat : Decorator Http

This commit is contained in:
2025-09-07 10:15:57 +08:00
parent abb354ebe0
commit 04c4678e2e
9 changed files with 226 additions and 8 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Lib\Request;
use App\Interface\Test\Decorator\HttpClientInterface;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use Psr\Http\Message\ResponseInterface;
class GuzzleHttpClient implements HttpClientInterface
{
/**
* @param string $method
* @param string $url
* @param array $options
* @return ResponseInterface
* @throws GuzzleException
*/
public function request(
string $method,
string $url,
array $options = []
): ResponseInterface
{
$client = new Client();
return $client->request($method, $url, $options);
}
}