forked from quantum-php/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHttpClientFactory.php
More file actions
35 lines (28 loc) · 780 Bytes
/
Copy pathHttpClientFactory.php
File metadata and controls
35 lines (28 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
declare(strict_types=1);
/**
* Quantum PHP Framework
* An open-source software development framework for PHP
* @link https://quantumphp.io
*/
namespace Quantum\HttpClient\Factories;
use Quantum\HttpClient\HttpClient;
/**
* Class HttpClientFactory
* @package Quantum\HttpClient
*/
class HttpClientFactory
{
public static function createRequest(string $url): HttpClient
{
return (new HttpClient())->createRequest($url);
}
public static function createMultiRequest(): HttpClient
{
return (new HttpClient())->createMultiRequest();
}
public static function createAsyncMultiRequest(callable $success, callable $error): HttpClient
{
return (new HttpClient())->createAsyncMultiRequest($success, $error);
}
}