From 00b139ca9ea9639b3f59c5ac2c920a777f397016 Mon Sep 17 00:00:00 2001 From: Jay Salvat Date: Fri, 18 Jul 2014 14:27:53 +0200 Subject: [PATCH] Fix Exception and replace it by InvalidArgumentException --- src/Image2Css/Converter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Image2Css/Converter.php b/src/Image2Css/Converter.php index ccfac87..64e945f 100644 --- a/src/Image2Css/Converter.php +++ b/src/Image2Css/Converter.php @@ -50,7 +50,7 @@ public function setColorType($type) if ($type !== \Image2Css\Converter::HEXA && $type !== \Image2Css\Converter::RGBA && $type !== \Image2Css\Converter::BEST) { - throw new Exception('Color type not allowed.'); + throw new \InvalidArgumentException('Color type not allowed.'); } $this->color_type = $type; } @@ -123,10 +123,10 @@ public function load($filename) $this->image = imagecreatefrompng($filename); break; default: - throw new Exception('Image Type not allowed.'); + throw new \InvalidArgumentException('Image Type not allowed.'); } } else { - throw new Exception('The file must be a valid image.'); + throw new \InvalidArgumentException('The file must be a valid image.'); } }