for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Deltatuts\Fixer\Endpoint;
use Deltatuts\Fixer\FixerHttpClient;
use GuzzleHttp\ClientInterface;
abstract class AbstractBaseEndpoint
{
/**
* Path to be appended after the base URI.
*
* @var string
*/
const ENDPOINT_URI = '';
* HTTP GET method.
const GET = 'GET';
* Keyword to pass the API key on each call.
const ACCESS_PARAM = 'access_token';
* @var ClientInterface|FixerHttpClient
protected $client;
* AbstractBaseEndpoint constructor.
* @param ClientInterface $client
public function __construct(ClientInterface $client)
$this->client = $client;
}
* Query parameters to be appended to the endpoint URI.
* @param array $params
* @return string
public function buildUri(array $params = []): string
$params[self::ACCESS_PARAM] = $this->client->getApiKey();
$query = http_build_query($params);
return join('?', [static::ENDPOINT_URI, $query]);