first commit

This commit is contained in:
2025-01-06 20:47:25 +01:00
commit 3bdbd78c2f
25591 changed files with 3586440 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace Empik\Marketplace\Factory;
use Empik\Marketplace\API\HttpClientInterface;
use Empik\Marketplace\API\HttpCurlClient;
use Exception;
class HttpClientsFactory
{
/**
* @param null $handler
* @return HttpClientInterface
* @throws Exception
*/
public static function createHttpClient($handler = null)
{
return self::detectDefaultClient();
}
/**
* @return HttpClientInterface
* @throws Exception
*/
private static function detectDefaultClient()
{
if (function_exists('curl_version')) {
return new HttpCurlClient();
}
throw new Exception('Unable to detect default HTTP client.');
}
}