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

Commit 7bfaaa7

Browse files
author
Julien Neuhart
authored
Merge pull request #21 from rodnaph/client-interface
Client Interface
2 parents 97cb313 + dad5d73 commit 7bfaaa7

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: "Continuous Integration"
22

33
on:
44
pull_request:
5-
pull_request_target:
65
push:
76
branches:
87
- master

src/Client.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use function fopen;
1616
use function fwrite;
1717

18-
final class Client
18+
final class Client implements GotenbergClientInterface
1919
{
2020
/** @var HttpClient */
2121
private $client;
@@ -30,7 +30,7 @@ public function __construct(string $apiURL, ?HttpClient $client = null)
3030
}
3131

3232
/**
33-
* Sends the given documents to the API and returns the response.
33+
* {@inheritdoc}
3434
*
3535
* @throws ClientException
3636
* @throws Exception
@@ -41,7 +41,7 @@ public function post(GotenbergRequestInterface $request): ResponseInterface
4141
}
4242

4343
/**
44-
* Sends the given documents to the API, stores the resulting PDF in the given destination.
44+
* {@inheritdoc}
4545
*
4646
* @throws ClientException
4747
* @throws RequestException

src/GotenbergClientInterface.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace TheCodingMachine\Gotenberg;
6+
7+
use Psr\Http\Message\ResponseInterface;
8+
9+
interface GotenbergClientInterface
10+
{
11+
/**
12+
* Sends the given documents to the API and returns the response.
13+
*/
14+
public function post(GotenbergRequestInterface $request): ResponseInterface;
15+
16+
/**
17+
* Sends the given documents to the API, stores the resulting PDF in the given destination.
18+
*/
19+
public function store(GotenbergRequestInterface $request, string $destination): void;
20+
}

0 commit comments

Comments
 (0)