allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s

This commit is contained in:
2026-03-30 14:54:57 +07:00
parent 66aed7c4e8
commit b5e3a778ce
21316 changed files with 2777892 additions and 13 deletions

View File

@@ -0,0 +1,81 @@
<?php
namespace MercadoPago\Http;
use Exception;
/**
* CurlRequest Class Doc Comment
*
* @package MercadoPago\Http
*/
class CurlRequest
implements HttpRequest
{
/**
* @var null|resource
*/
private $handle = null;
/**
* @codeCoverageIgnore
* CurlRequest constructor.
*
* @param null $uri
*/
public function __construct($uri = null)
{
if (!extension_loaded("curl")) {
throw new Exception("cURL extension not found. You need to enable cURL in your php.ini or another configuration you have.");
}
$this->handle = curl_init($uri);
return $this->handle;
}
/**
* @codeCoverageIgnore
* @param $name
* @param $value
*/
public function setOption($name, $value)
{
curl_setopt($this->handle, $name, $value);
}
/**
* @codeCoverageIgnore
* @return mixed
*/
public function execute()
{
return curl_exec($this->handle);
}
/**
* @codeCoverageIgnore
* @param $name
*
* @return mixed
*/
public function getInfo($name)
{
return curl_getinfo($this->handle, $name);
}
/**
*@codeCoverageIgnore
*/
public function close()
{
curl_close($this->handle);
}
/**
* @codeCoverageIgnore
* @return string
*/
public function error()
{
return curl_error($this->handle);
}
}

View File

@@ -0,0 +1,39 @@
<?php
namespace MercadoPago\Http;
/**
* Interface HttpRequest
*
* @package MercadoPago\Http
*/
interface HttpRequest
{
/**
* @param $name
* @param $value
*
* @return mixed
*/
public function setOption($name, $value);
/**
* @return mixed
*/
public function execute();
/**
* @param $name
*
* @return mixed
*/
public function getInfo($name);
/**
* @return mixed
*/
public function close();
/**
* @return mixed
*/
public function error();
}