Skip to content

Commit

Permalink
requested minor adjustments from round 2 reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
patinthehat committed Jun 10, 2024
1 parent 99f18ad commit ddb0443
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Exceptions/InvalidLayerMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class InvalidLayerMethod extends Exception
{
public static function for(int $value)
public static function for(int $value): static
{
return new static("Invalid layer method value ({$value}).");
}
Expand Down
6 changes: 4 additions & 2 deletions src/Exceptions/InvalidQuality.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

namespace Spatie\PdfToImage\Exceptions;

class InvalidQuality extends \Exception
use Exception;

class InvalidQuality extends Exception
{
public static function for(int $value): self
public static function for(int $value): static
{
return new static("Quality must be between 1 and 100, {$value} given.");
}
Expand Down
10 changes: 6 additions & 4 deletions src/Exceptions/InvalidSize.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@

namespace Spatie\PdfToImage\Exceptions;

class InvalidSize extends \Exception
use Exception;

class InvalidSize extends Exception
{
public static function for(int $value, string $type, string $property): self
public static function for(int $value, string $type, string $property): static
{
return new static(ucfirst($type)." {$property} must be greater than or equal to 0, {$value} given.");
}

public static function forThumbnail(int $value, string $property): self
public static function forThumbnail(int $value, string $property): static
{
return self::for($value, 'thumbnail', $property);
}

public static function forImage(int $value, string $property): self
public static function forImage(int $value, string $property): static
{
return self::for($value, 'image', $property);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/PageDoesNotExist.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class PageDoesNotExist extends Exception
{
public static function for(int $pageNumber): self
public static function for(int $pageNumber): static
{
return new static("Page {$pageNumber} does not exist.");
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/PdfDoesNotExist.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class PdfDoesNotExist extends Exception
{
public static function for(string $pdfFile): self
public static function for(string $pdfFile): static
{
return new static("File '{$pdfFile}' does not exist.");
}
Expand Down
2 changes: 1 addition & 1 deletion src/Pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ protected function determineOutputFormat(string $pathToImage): OutputFormat
return $outputFormat;
}

protected function validatePageNumbers(int ...$pageNumbers)
protected function validatePageNumbers(int ...$pageNumbers): void
{
$count = $this->pageCount();

Expand Down

0 comments on commit ddb0443

Please sign in to comment.