for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace KaLLoSz\Twig\Extension\Client;
use GuzzleHttp\ClientInterface;
use KaLLoSz\Twig\Extension\IframelyClientInterface;
use Psr\Http\Message\ResponseInterface;
class GuzzleClient implements IframelyClientInterface
{
/**
* @var null|string
*/
private $apiKey;
* @var ClientInterface
private $client;
* Class constructor.
*
* @param string|null $apiKey API key.
* @param ClientInterface $client Guzzle Client
public function __construct(string $apiKey, ClientInterface $client)
$this->apiKey = $apiKey;
$this->client = $client;
}
* {@inheritdoc}
public function getUrlData(string $url): ResponseInterface
return $this->client->request('GET', '', ['query' => ['api_key' => $this->apiKey, 'url' => $url]]);