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 Apr 5, 2023
1 parent b770b55 commit 9812b23
Show file tree
Hide file tree
Showing 8 changed files with 338 additions and 338 deletions.
20 changes: 10 additions & 10 deletions src/Exceptions/ConfigurationException.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

namespace Statikbe\PuppeteerPdfConverter\Exceptions;
namespace Statikbe\PuppeteerPdfConverter\Exceptions;

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

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;
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;

return $exception;
}
return $exception;
}
}
20 changes: 10 additions & 10 deletions src/Exceptions/ConversionException.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

namespace Statikbe\PuppeteerPdfConverter\Exceptions;
namespace Statikbe\PuppeteerPdfConverter\Exceptions;

/**
* If an error occurs during the PDF conversion, this error is thrown.
* Class ConversionException
* @package Statikbe\PuppeteerPdfConverter\Exceptions
*/
/**
* If an error occurs during the PDF conversion, this error is thrown.
* Class ConversionException
* @package Statikbe\PuppeteerPdfConverter\Exceptions
*/


class ConversionException extends PdfApiException
{
public const API_ERROR_TYPE = 'CONVERSION_ERROR';
}
class ConversionException extends PdfApiException
{
public const API_ERROR_TYPE = 'CONVERSION_ERROR';
}
8 changes: 4 additions & 4 deletions src/Exceptions/InvalidMarginUnitException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

namespace Statikbe\PuppeteerPdfConverter\Exceptions;
namespace Statikbe\PuppeteerPdfConverter\Exceptions;

class InvalidMarginUnitException extends \Exception
{
}
class InvalidMarginUnitException extends \Exception
{
}
18 changes: 9 additions & 9 deletions src/Exceptions/PdfApiException.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

namespace Statikbe\PuppeteerPdfConverter\Exceptions;
namespace Statikbe\PuppeteerPdfConverter\Exceptions;

class PdfApiException extends \Exception
class PdfApiException extends \Exception
{
public function setApiError(array $apiErrorFields): self
{
public function setApiError(array $apiErrorFields): self
{
if (array_key_exists('message', $apiErrorFields)) {
$this->message = $apiErrorFields['message'];
}

return $this;
if (array_key_exists('message', $apiErrorFields)) {
$this->message = $apiErrorFields['message'];
}

return $this;
}
}
20 changes: 10 additions & 10 deletions src/Exceptions/TimeoutException.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

namespace Statikbe\PuppeteerPdfConverter\Exceptions;
namespace Statikbe\PuppeteerPdfConverter\Exceptions;

/**
* If the PDF conversion API times out, this exception is thrown.
* Class TimeoutException
* @package Statikbe\PuppeteerPdfConverter\Exceptions
*/
/**
* If the PDF conversion API times out, this exception is thrown.
* Class TimeoutException
* @package Statikbe\PuppeteerPdfConverter\Exceptions
*/


class TimeoutException extends PdfApiException
{
public const API_ERROR_TYPE = 'TIMEOUT_ERROR';
}
class TimeoutException extends PdfApiException
{
public const API_ERROR_TYPE = 'TIMEOUT_ERROR';
}
56 changes: 28 additions & 28 deletions src/Exceptions/UnsuccessfulHttpResponseException.php
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
<?php

namespace Statikbe\PuppeteerPdfConverter\Exceptions;

/**
* If the web page that needs to be converted to PDF returns an HTTP status code that is not successful (i.e. 2xx),
* this exception is thrown.
*
* Class UnsuccessfulHttpResponseException
* @package Statikbe\PuppeteerPdfConverter\Exceptions
*/
namespace Statikbe\PuppeteerPdfConverter\Exceptions;

/**
* If the web page that needs to be converted to PDF returns an HTTP status code that is not successful (i.e. 2xx),
* this exception is thrown.
*
* Class UnsuccessfulHttpResponseException
* @package Statikbe\PuppeteerPdfConverter\Exceptions
*/

class UnsuccessfulHttpResponseException extends PdfApiException
{
public const API_ERROR_TYPE = 'UNSUCCESSFUL_HTTP_RESPONSE';

protected $websiteStatusCode = null;
class UnsuccessfulHttpResponseException extends PdfApiException
{
public const API_ERROR_TYPE = 'UNSUCCESSFUL_HTTP_RESPONSE';

public function setApiError(array $apiErrorFields): parent
{
parent::setApiError($apiErrorFields);
if (array_key_exists('websiteStatusCode', $apiErrorFields)) {
$this->websiteStatusCode = $apiErrorFields['websiteStatusCode'];
}
protected $websiteStatusCode = null;

return $this;
public function setApiError(array $apiErrorFields): parent
{
parent::setApiError($apiErrorFields);
if (array_key_exists('websiteStatusCode', $apiErrorFields)) {
$this->websiteStatusCode = $apiErrorFields['websiteStatusCode'];
}

/**
* Returns the HTTP status code that was returned by the webpage url that was requested to be converted.
* @return int
*/
public function getWebsiteStatusCode(): int
{
return $this->websiteStatusCode;
}
return $this;
}

/**
* Returns the HTTP status code that was returned by the webpage url that was requested to be converted.
* @return int
*/
public function getWebsiteStatusCode(): int
{
return $this->websiteStatusCode;
}
}
Loading

0 comments on commit 9812b23

Please sign in to comment.