for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Josepostiga\DockerRegistry\Services;
use GuzzleHttp\Client;
use Josepostiga\DockerRegistry\Contracts\DockerRegistryClientInterface;
class LocalDockerRegistryClient implements DockerRegistryClientInterface
{
/**
* @var string
*/
private $url;
* @var int
private $port;
* @var Client
private $client;
private $version;
* DockerRegistryApiClient constructor.
*
* @param string $url
* @param int $port
* @param string $version
public function __construct(string $url, int $port, string $version)
$this->url = $url;
$this->port = $port;
$this->version = $version;
$this->client = new Client([
'base_uri' => "{$this->getUrl()}:{$this->getPort()}/{$this->getVersion()}",
]);
}
* @return string
public function getUrl(): string
return $this->url;
* @return int
public function getPort(): int
return $this->port;
public function getVersion(): string
return $this->version;
* @return Client
public function getClient(): Client
return $this->client;
* Proxies method calls to the Http client instance.
* @param $resource
* @param $arguments
* @return mixed
public function call($resource, $arguments = null)
return $this->getClient()->$resource(...$arguments);