generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main'
- Loading branch information
Showing
11 changed files
with
344 additions
and
340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.