Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #21 from rodnaph/client-interface
Browse files Browse the repository at this point in the history
Client Interface
  • Loading branch information
gulien authored Jan 4, 2021
2 parents 97cb313 + dad5d73 commit 7bfaaa7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: "Continuous Integration"

on:
pull_request:
pull_request_target:
push:
branches:
- master
Expand Down
6 changes: 3 additions & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use function fopen;
use function fwrite;

final class Client
final class Client implements GotenbergClientInterface
{
/** @var HttpClient */
private $client;
Expand All @@ -30,7 +30,7 @@ public function __construct(string $apiURL, ?HttpClient $client = null)
}

/**
* Sends the given documents to the API and returns the response.
* {@inheritdoc}
*
* @throws ClientException
* @throws Exception
Expand All @@ -41,7 +41,7 @@ public function post(GotenbergRequestInterface $request): ResponseInterface
}

/**
* Sends the given documents to the API, stores the resulting PDF in the given destination.
* {@inheritdoc}
*
* @throws ClientException
* @throws RequestException
Expand Down
20 changes: 20 additions & 0 deletions src/GotenbergClientInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

namespace TheCodingMachine\Gotenberg;

use Psr\Http\Message\ResponseInterface;

interface GotenbergClientInterface
{
/**
* Sends the given documents to the API and returns the response.
*/
public function post(GotenbergRequestInterface $request): ResponseInterface;

/**
* Sends the given documents to the API, stores the resulting PDF in the given destination.
*/
public function store(GotenbergRequestInterface $request, string $destination): void;
}

0 comments on commit 7bfaaa7

Please sign in to comment.