1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-01 11:30:16 +02:00

Remove redundant expections

This commit is contained in:
Oliver Vogel
2023-11-25 14:38:05 +01:00
parent 516e963883
commit 3d9272f353
7 changed files with 4 additions and 36 deletions

View File

@@ -2,7 +2,7 @@
namespace Intervention\Image\Drivers;
use Intervention\Image\Exceptions\MissingDriverComponentException;
use Intervention\Image\Exceptions\NotSupportedException;
use Intervention\Image\Interfaces\DriverInterface;
use ReflectionClass;
@@ -15,7 +15,7 @@ abstract class AbstractDriver implements DriverInterface
$specialized = $driver_namespace . "\\" . $class_path;
if (! class_exists($specialized)) {
throw new MissingDriverComponentException(
throw new NotSupportedException(
"Class '" . $class_path . "' is not supported by " . $this->id() . " driver."
);
}

View File

@@ -6,14 +6,11 @@ use Intervention\Image\Colors\Rgb\Channels\Blue;
use Intervention\Image\Colors\Rgb\Channels\Green;
use Intervention\Image\Colors\Rgb\Channels\Red;
use Intervention\Image\Drivers\DriverModifier;
use Intervention\Image\Exceptions\RuntimeException;
use Intervention\Image\Exceptions\MissingDriverComponentException;
use Intervention\Image\Geometry\Rectangle;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\FrameInterface;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Modifiers\FillModifier;
use ReflectionException;
class RotateModifier extends DriverModifier
{
@@ -35,9 +32,6 @@ class RotateModifier extends DriverModifier
* @param FrameInterface $frame
* @param ColorInterface $background
* @return void
* @throws RuntimeException
* @throws MissingDriverComponentException
* @throws ReflectionException
*/
protected function modifyFrame(FrameInterface $frame, ColorInterface $background): void
{

View File

@@ -1,8 +0,0 @@
<?php
namespace Intervention\Image\Exceptions;
class ConfigurationException extends \RuntimeException
{
//
}

View File

@@ -1,8 +0,0 @@
<?php
namespace Intervention\Image\Exceptions;
class EncoderException extends \RuntimeException
{
//
}

View File

@@ -1,8 +0,0 @@
<?php
namespace Intervention\Image\Exceptions;
class MissingDriverComponentException extends \RuntimeException
{
//
}

View File

@@ -9,7 +9,7 @@ use Intervention\Image\Drivers\Gd\Driver;
use Intervention\Image\Drivers\Gd\Frame;
use Intervention\Image\EncodedImage;
use Intervention\Image\Encoders\PngEncoder;
use Intervention\Image\Exceptions\MissingDriverComponentException;
use Intervention\Image\Exceptions\NotSupportedException;
use Intervention\Image\Image;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ColorspaceInterface;
@@ -125,7 +125,7 @@ class ImageTest extends TestCase
public function testProfile(): void
{
$this->expectException(MissingDriverComponentException::class);
$this->expectException(NotSupportedException::class);
$this->image->profile();
}

View File

@@ -11,7 +11,6 @@ use Intervention\Image\Drivers\Imagick\Frame;
use Intervention\Image\EncodedImage;
use Intervention\Image\Encoders\PngEncoder;
use Intervention\Image\Exceptions\ColorException;
use Intervention\Image\Exceptions\MissingDriverComponentException;
use Intervention\Image\Image;
use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\ColorspaceInterface;
@@ -19,7 +18,6 @@ use Intervention\Image\Interfaces\ResolutionInterface;
use Intervention\Image\Interfaces\SizeInterface;
use Intervention\Image\Modifiers\GreyscaleModifier;
use Intervention\Image\Tests\TestCase;
use Intervention\Image\Typography\Font;
class ImageTest extends TestCase
{