Skip to content

Commit

Permalink
[Update] a few things
Browse files Browse the repository at this point in the history
  • Loading branch information
Neirda24 committed Nov 15, 2024
1 parent 8d39bd9 commit ebb4656
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 48 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
.php-cs-fixer.cache
.phpunit.result.cache
composer.lock
phpstan.neon
3 changes: 0 additions & 3 deletions docs/pdf/builders_api/ConvertPdfBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH
Sets the webhook for cases of error.
Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH.

* `webhookUrls(string $successWebhook, ?string $errorWebhook, ?string $successMethod, ?string $errorMethod)`:
Allows to set both $successWebhook and $errorWebhook URLs. If $errorWebhook is not provided, it will fallback to $successWebhook one.

* `webhookExtraHeaders(array $extraHeaders)`:
Extra headers that will be provided to the webhook endpoint. May it either be Success or Error.

3 changes: 0 additions & 3 deletions docs/pdf/builders_api/HtmlPdfBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH
Sets the webhook for cases of error.
Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH.

* `webhookUrls(string $successWebhook, ?string $errorWebhook, ?string $successMethod, ?string $errorMethod)`:
Allows to set both $successWebhook and $errorWebhook URLs. If $errorWebhook is not provided, it will fallback to $successWebhook one.

* `webhookExtraHeaders(array $extraHeaders)`:
Extra headers that will be provided to the webhook endpoint. May it either be Success or Error.

Expand Down
3 changes: 0 additions & 3 deletions docs/pdf/builders_api/LibreOfficePdfBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH
Sets the webhook for cases of error.
Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH.

* `webhookUrls(string $successWebhook, ?string $errorWebhook, ?string $successMethod, ?string $errorMethod)`:
Allows to set both $successWebhook and $errorWebhook URLs. If $errorWebhook is not provided, it will fallback to $successWebhook one.

* `webhookExtraHeaders(array $extraHeaders)`:
Extra headers that will be provided to the webhook endpoint. May it either be Success or Error.

3 changes: 0 additions & 3 deletions docs/pdf/builders_api/MarkdownPdfBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH
Sets the webhook for cases of error.
Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH.

* `webhookUrls(string $successWebhook, ?string $errorWebhook, ?string $successMethod, ?string $errorMethod)`:
Allows to set both $successWebhook and $errorWebhook URLs. If $errorWebhook is not provided, it will fallback to $successWebhook one.

* `webhookExtraHeaders(array $extraHeaders)`:
Extra headers that will be provided to the webhook endpoint. May it either be Success or Error.

Expand Down
3 changes: 0 additions & 3 deletions docs/pdf/builders_api/MergePdfBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH
Sets the webhook for cases of error.
Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH.

* `webhookUrls(string $successWebhook, ?string $errorWebhook, ?string $successMethod, ?string $errorMethod)`:
Allows to set both $successWebhook and $errorWebhook URLs. If $errorWebhook is not provided, it will fallback to $successWebhook one.

* `webhookExtraHeaders(array $extraHeaders)`:
Extra headers that will be provided to the webhook endpoint. May it either be Success or Error.

3 changes: 0 additions & 3 deletions docs/pdf/builders_api/UrlPdfBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH
Sets the webhook for cases of error.
Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH.

* `webhookUrls(string $successWebhook, ?string $errorWebhook, ?string $successMethod, ?string $errorMethod)`:
Allows to set both $successWebhook and $errorWebhook URLs. If $errorWebhook is not provided, it will fallback to $successWebhook one.

* `webhookExtraHeaders(array $extraHeaders)`:
Extra headers that will be provided to the webhook endpoint. May it either be Success or Error.

Expand Down
3 changes: 0 additions & 3 deletions docs/screenshot/builders_api/HtmlScreenshotBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH
Sets the webhook for cases of error.
Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH.

* `webhookUrls(string $successWebhook, ?string $errorWebhook, ?string $successMethod, ?string $errorMethod)`:
Allows to set both $successWebhook and $errorWebhook URLs. If $errorWebhook is not provided, it will fallback to $successWebhook one.

* `webhookExtraHeaders(array $extraHeaders)`:
Extra headers that will be provided to the webhook endpoint. May it either be Success or Error.

Expand Down
3 changes: 0 additions & 3 deletions docs/screenshot/builders_api/MarkdownScreenshotBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH
Sets the webhook for cases of error.
Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH.

* `webhookUrls(string $successWebhook, ?string $errorWebhook, ?string $successMethod, ?string $errorMethod)`:
Allows to set both $successWebhook and $errorWebhook URLs. If $errorWebhook is not provided, it will fallback to $successWebhook one.

* `webhookExtraHeaders(array $extraHeaders)`:
Extra headers that will be provided to the webhook endpoint. May it either be Success or Error.

Expand Down
3 changes: 0 additions & 3 deletions docs/screenshot/builders_api/UrlScreenshotBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH
Sets the webhook for cases of error.
Optionaly sets a custom HTTP method for such endpoint among : POST, PUT or PATCH.

* `webhookUrls(string $successWebhook, ?string $errorWebhook, ?string $successMethod, ?string $errorMethod)`:
Allows to set both $successWebhook and $errorWebhook URLs. If $errorWebhook is not provided, it will fallback to $successWebhook one.

* `webhookExtraHeaders(array $extraHeaders)`:
Extra headers that will be provided to the webhook endpoint. May it either be Success or Error.

Expand Down
File renamed without changes.
30 changes: 10 additions & 20 deletions src/Builder/AsyncBuilderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,16 @@ public function webhookConfiguration(string $name): static
{
$webhookConfiguration = $this->webhookConfigurationRegistry->get($name);

$result = $this->webhookUrls(
$webhookConfiguration['success']['url'],
$webhookConfiguration['error']['url'],
$webhookConfiguration['success']['method'],
$webhookConfiguration['error']['method'],
);
$result = $this
->webhookUrl(
$webhookConfiguration['success']['url'],
$webhookConfiguration['error']['url'],
)
->errorWebhookUrl(
$webhookConfiguration['error']['url'],
$webhookConfiguration['error']['method'],
)
;

if (\array_key_exists('extra_http_headers', $webhookConfiguration)) {
$result = $result->webhookExtraHeaders($webhookConfiguration['extra_http_headers']);
Expand Down Expand Up @@ -115,20 +119,6 @@ public function errorWebhookUrl(string|null $url = null, string|null $method = n
return $this;
}

/**
* Allows to set both $successWebhook and $errorWebhook URLs. If $errorWebhook is not provided, it will fallback to $successWebhook one.
*
* @param 'POST'|'PATCH'|'PUT'|null $successMethod
* @param 'POST'|'PATCH'|'PUT'|null $errorMethod
*/
public function webhookUrls(string $successWebhook, string|null $errorWebhook = null, string|null $successMethod = null, string|null $errorMethod = null): static
{
return $this
->webhookUrl($successWebhook, $successMethod)
->errorWebhookUrl($errorWebhook, $errorMethod)
;
}

/**
* Extra headers that will be provided to the webhook endpoint. May it either be Success or Error.
*
Expand Down
3 changes: 2 additions & 1 deletion src/DependencyInjection/SensiolabsGotenbergExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public function load(array $configs, ContainerBuilder $container): void
* url: array<string, mixed>,
* markdown: array<string, mixed>
* }
* } $config
* }
* } $config
*/
$config = $this->processConfiguration($configuration, $configs);

Expand Down

0 comments on commit ebb4656

Please sign in to comment.