Skip to content

Commit

Permalink
Edit error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Jan 15, 2024
1 parent c534d4a commit 4462e64
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Colors/AbstractColor.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function channel(string $classname): ColorChannelInterface
});

if (count($channels) == 0) {
throw new ColorException('Channel ' . $classname . ' could not be found.');
throw new ColorException('Color channel ' . $classname . ' could not be found.');
}

return reset($channels);
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Gd/ColorProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function colorToNative(ColorInterface $color): int
public function nativeToColor(mixed $value): ColorInterface
{
if (! is_int($value)) {
throw new ColorException("GD driver can only decode colors in integer format.");
throw new ColorException('GD driver can only decode colors in integer format.');
}

$a = ($value >> 24) & 0xFF;
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Gd/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function checkHealth(): void
{
if (!extension_loaded('gd') || !function_exists('gd_info')) {
throw new RuntimeException(
'GD Library extension not available with this PHP installation.'
'GD PHP extension must be installed to use this driver.'
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Gd/Modifiers/ColorspaceModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function apply(ImageInterface $image): ImageInterface
{
if (!is_a($this->targetColorspace(), RgbColorspace::class)) {
throw new NotSupportedException(
'Only RGB colorspace is supported with GD driver.'
'Only RGB colorspace is supported by GD driver.'
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Imagick/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function frame(int $position): FrameInterface
}
}

throw new AnimationException('Frame #' . $position . ' is not be found in the image.');
throw new AnimationException('Frame #' . $position . ' could not be found in the image.');
}

public function loops(): int
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Imagick/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function checkHealth(): void
{
if (!extension_loaded('imagick') || !class_exists('Imagick')) {
throw new RuntimeException(
'ImageMagick extension not available with this PHP installation.'
'Imagick PHP extension must be installed to use this driver.'
);
}
}
Expand Down

0 comments on commit 4462e64

Please sign in to comment.