1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-29 08:40:33 +02:00

Remove unused class

This commit is contained in:
Oliver Vogel
2023-10-21 10:00:13 +02:00
parent 774e1b80a3
commit e8dec6126b
2 changed files with 4 additions and 38 deletions

View File

@@ -1,35 +0,0 @@
<?php
namespace Intervention\Image\Drivers\Abstract;
use Intervention\Image\Interfaces\ColorInterface;
abstract class AbstractColor implements ColorInterface
{
/**
* Format color to hexadecimal color code
*
* @param string $prefix
* @return string
*/
public function toHex(string $prefix = ''): string
{
return sprintf(
'%s%02x%02x%02x',
$prefix,
$this->red(),
$this->green(),
$this->blue()
);
}
/**
* Determine if color is greyscale
*
* @return boolean
*/
public function isGreyscale(): bool
{
return ($this->red() === $this->green()) && ($this->green() === $this->blue());
}
}

View File

@@ -4,6 +4,7 @@ namespace Intervention\Image\Tests;
use Intervention\Image\Drivers\Gd\Modifiers\GreyscaleModifier;
use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\ModifierInterface;
use Intervention\Image\ModifierStack;
use Mockery;
@@ -29,14 +30,14 @@ class ModifierStackTest extends TestCase
{
$image = Mockery::mock(ImageInterface::class);
$modifier1 = Mockery::mock(AbstractColor::class)->makePartial();
$modifier1 = Mockery::mock(ModifierInterface::class)->makePartial();
$modifier1->shouldReceive('apply')->once()->with($image);
$modifier2 = Mockery::mock(AbstractColor::class)->makePartial();
$modifier2 = Mockery::mock(ModifierInterface::class)->makePartial();
$modifier2->shouldReceive('apply')->once()->with($image);
$stack = new ModifierStack([$modifier1, $modifier2]);
$result = $stack->apply($image);
$this->assertInstanceOf(ImageInterface::class, $image);
$this->assertInstanceOf(ImageInterface::class, $result);
}
}