fix deprecations on ElixFormsClient
This commit is contained in:
@@ -11,7 +11,7 @@ class ElixFormsClient
|
|||||||
private string $baseUrl;
|
private string $baseUrl;
|
||||||
private Client $httpClient;
|
private Client $httpClient;
|
||||||
|
|
||||||
public function __construct(string $baseUrl, Client $httpClient = null)
|
public function __construct(string $baseUrl, ?Client $httpClient)
|
||||||
{
|
{
|
||||||
$this->baseUrl = rtrim($baseUrl, '/');
|
$this->baseUrl = rtrim($baseUrl, '/');
|
||||||
$this->httpClient = $httpClient ?? new Client(['timeout' => 10.0, 'http_errors' => false]);
|
$this->httpClient = $httpClient ?? new Client(['timeout' => 10.0, 'http_errors' => false]);
|
||||||
@@ -22,7 +22,7 @@ class ElixFormsClient
|
|||||||
return new AuthClient($this->baseUrl, $this->httpClient);
|
return new AuthClient($this->baseUrl, $this->httpClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function request(string $method, string $path, ?array $body = null, array $headers = []): array
|
public function request(string $method, string $path, ?array $body, array $headers = []): array
|
||||||
{
|
{
|
||||||
$url = $this->baseUrl . '/' . ltrim($path, '/');
|
$url = $this->baseUrl . '/' . ltrim($path, '/');
|
||||||
$options = ['headers' => $headers];
|
$options = ['headers' => $headers];
|
||||||
|
|||||||
Reference in New Issue
Block a user