1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-14 01:44:03 +02:00

Edit error messages

This commit is contained in:
Oliver Vogel
2024-01-15 08:36:17 +01:00
parent c534d4aaa8
commit 4462e64704
6 changed files with 6 additions and 6 deletions

View File

@@ -26,7 +26,7 @@ abstract class AbstractColor implements ColorInterface
}); });
if (count($channels) == 0) { 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); return reset($channels);

View File

@@ -40,7 +40,7 @@ class ColorProcessor implements ColorProcessorInterface
public function nativeToColor(mixed $value): ColorInterface public function nativeToColor(mixed $value): ColorInterface
{ {
if (! is_int($value)) { 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; $a = ($value >> 24) & 0xFF;

View File

@@ -32,7 +32,7 @@ class Driver extends AbstractDriver
{ {
if (!extension_loaded('gd') || !function_exists('gd_info')) { if (!extension_loaded('gd') || !function_exists('gd_info')) {
throw new RuntimeException( throw new RuntimeException(
'GD Library extension not available with this PHP installation.' 'GD PHP extension must be installed to use this driver.'
); );
} }
} }

View File

@@ -16,7 +16,7 @@ class ColorspaceModifier extends DriverSpecializedModifier
{ {
if (!is_a($this->targetColorspace(), RgbColorspace::class)) { if (!is_a($this->targetColorspace(), RgbColorspace::class)) {
throw new NotSupportedException( throw new NotSupportedException(
'Only RGB colorspace is supported with GD driver.' 'Only RGB colorspace is supported by GD driver.'
); );
} }

View File

@@ -95,7 +95,7 @@ class Core implements CoreInterface, Iterator
} }
} }
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 public function loops(): int

View File

@@ -34,7 +34,7 @@ class Driver extends AbstractDriver
{ {
if (!extension_loaded('imagick') || !class_exists('Imagick')) { if (!extension_loaded('imagick') || !class_exists('Imagick')) {
throw new RuntimeException( throw new RuntimeException(
'ImageMagick extension not available with this PHP installation.' 'Imagick PHP extension must be installed to use this driver.'
); );
} }
} }