Skip to content

Commit

Permalink
lint: apply changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bepsvpt committed Oct 13, 2024
1 parent dcf9a92 commit 379b289
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/BlurHash.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public function __construct(
'php-vips' => VipsDriver::class,
];

if (! isset($drivers[$loader])) {
if (! isset($drivers[$loader])) { // @phpstan-ignore isset.offset
throw new DriverNotFoundException(
sprintf('"%s" is not a valid driver.', $loader),
);
Expand Down
8 changes: 4 additions & 4 deletions src/Drivers/GdDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function read(string $path): GdImage
public function resize(object $origin): GdImage
{
if (imagepalettetotruecolor($origin) === false) {
throw new UnableToConvertColorException();
throw new UnableToConvertColorException;
}

[$originWidth, $originHeight] = $this->size($origin);
Expand Down Expand Up @@ -162,7 +162,7 @@ public function resize(object $origin): GdImage
*/
public function size(object $image): array
{
return [ // @phpstan-ignore-line
return [
imagesx($image),
imagesy($image),
];
Expand Down Expand Up @@ -198,7 +198,7 @@ public function create(int $width, int $height): static
$image = imagecreatetruecolor($width, $height);

if ($image === false) {
throw new UnableToCreateImageException();
throw new UnableToCreateImageException;
}

$this->image = $image;
Expand All @@ -216,7 +216,7 @@ public function pixel(int $x, int $y, array $color): bool
$draw = imagecolorallocate($this->image, ...$color);

if ($draw === false) {
throw new UnableToSetPixelException();
throw new UnableToSetPixelException;
}

return imagesetpixel($this->image, $x, $y, $draw);
Expand Down
10 changes: 5 additions & 5 deletions src/Drivers/ImagickDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function color(object $image, int $x, int $y): array|false
*/
public function create(int $width, int $height): static
{
$this->image = new Imagick();
$this->image = new Imagick;

try {
$this->image->newImage(
Expand All @@ -128,7 +128,7 @@ public function create(int $width, int $height): static
new ImagickPixel('transparent'),
);
} catch (ImagickException) {
throw new UnableToCreateImageException();
throw new UnableToCreateImageException;
}

return $this;
Expand All @@ -144,19 +144,19 @@ public function pixel(int $x, int $y, array $color): bool
try {
$rga = sprintf('rgb(%s,%s,%s)', ...$color);

$draw = new ImagickDraw();
$draw = new ImagickDraw;

$draw->setFillColor(new ImagickPixel($rga));

$draw->point($x, $y);

if ($this->image->drawImage($draw) === false) {
throw new UnableToSetPixelException();
throw new UnableToSetPixelException;
}

return true;
} catch (ImagickException|ImagickDrawException|ImagickPixelException) {
throw new UnableToSetPixelException();
throw new UnableToSetPixelException;
}
}
}
4 changes: 2 additions & 2 deletions src/Drivers/VipsDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function create(int $width, int $height): static

$this->memory = $this->image->writeToMemory();
} catch (Exception) {
throw new UnableToCreateImageException();
throw new UnableToCreateImageException;
}

return $this;
Expand Down Expand Up @@ -171,7 +171,7 @@ public function pixel(int $x, int $y, array $color): bool
$this->image->format,
);
} catch (Exception) {
throw new UnableToSetPixelException();
throw new UnableToSetPixelException;
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion tests/BlurHashTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected function setUp(): void
{
parent::setUp();

Config::setLogger(new DebugLogger());
Config::setLogger(new DebugLogger);
}

protected function file(string $name): string
Expand Down

0 comments on commit 379b289

Please sign in to comment.