Initial commit: CloudOps infrastructure platform
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace MauticPlugin\MauticCrmBundle\Services;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
|
||||
class Transport implements TransportInterface
|
||||
{
|
||||
public function __construct(
|
||||
private Client $client,
|
||||
) {
|
||||
}
|
||||
|
||||
public function post($uri, array $options = []): \Psr\Http\Message\ResponseInterface
|
||||
{
|
||||
return $this->client->request('POST', $uri, $options);
|
||||
}
|
||||
|
||||
public function put($uri, array $options = []): \Psr\Http\Message\ResponseInterface
|
||||
{
|
||||
return $this->client->request('PUT', $uri, $options);
|
||||
}
|
||||
|
||||
public function get($uri, array $options = []): \Psr\Http\Message\ResponseInterface
|
||||
{
|
||||
return $this->client->request('GET', $uri, $options);
|
||||
}
|
||||
|
||||
public function delete($uri, array $options = []): \Psr\Http\Message\ResponseInterface
|
||||
{
|
||||
return $this->client->request('DELETE', $uri, $options);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace MauticPlugin\MauticCrmBundle\Services;
|
||||
|
||||
interface TransportInterface
|
||||
{
|
||||
public function post($uri, array $options);
|
||||
|
||||
public function put($uri, array $options);
|
||||
|
||||
public function get($uri, array $options);
|
||||
|
||||
public function delete($uri, array $options);
|
||||
}
|
||||
Reference in New Issue
Block a user