Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
sten authored and github-actions[bot] committed Sep 8, 2022
1 parent f8580c1 commit e4393ef
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Exceptions/ConfigurationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

namespace Statikbe\PuppeteerPdfConverter\Exceptions;

class ConfigurationException extends \Exception {
class ConfigurationException extends \Exception
{
public string $field;

public static function create(string $field): self {
public static function create(string $field): self
{
$exception = new ConfigurationException("The Laravel Puppeteer PDF Converter library is not properly configured. Check if $field is properly configured.");
$exception->field = $field;

Expand Down
1 change: 1 addition & 0 deletions src/Exceptions/ConversionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Class ConversionException
* @package Statikbe\PuppeteerPdfConverter\Exceptions
*/

class ConversionException extends PdfApiException
{
public const API_ERROR_TYPE = 'CONVERSION_ERROR';
Expand Down
1 change: 1 addition & 0 deletions src/Exceptions/TimeoutException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Class TimeoutException
* @package Statikbe\PuppeteerPdfConverter\Exceptions
*/

class TimeoutException extends PdfApiException
{
public const API_ERROR_TYPE = 'TIMEOUT_ERROR';
Expand Down
1 change: 1 addition & 0 deletions src/Exceptions/UnsuccessfulHttpResponseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Class UnsuccessfulHttpResponseException
* @package Statikbe\PuppeteerPdfConverter\Exceptions
*/

class UnsuccessfulHttpResponseException extends PdfApiException
{
public const API_ERROR_TYPE = 'UNSUCCESSFUL_HTTP_RESPONSE';
Expand Down
2 changes: 1 addition & 1 deletion src/PuppeteerPdfConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function convertUrl(string $url, PdfOptions $pdfOptions = null): string

// prepare API call:
$pdfConversionApiUrl = config('puppeteer-pdf-converter.pdf_conversion_api');
if(!$pdfConversionApiUrl){
if (! $pdfConversionApiUrl) {
throw ConfigurationException::create('pdf_conversion_api');
}

Expand Down

0 comments on commit e4393ef

Please sign in to comment.