mirror of
https://github.com/Intervention/image.git
synced 2025-09-02 02:12:37 +02:00
Remove unused class
This commit is contained in:
@@ -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());
|
|
||||||
}
|
|
||||||
}
|
|
@@ -4,6 +4,7 @@ namespace Intervention\Image\Tests;
|
|||||||
|
|
||||||
use Intervention\Image\Drivers\Gd\Modifiers\GreyscaleModifier;
|
use Intervention\Image\Drivers\Gd\Modifiers\GreyscaleModifier;
|
||||||
use Intervention\Image\Interfaces\ImageInterface;
|
use Intervention\Image\Interfaces\ImageInterface;
|
||||||
|
use Intervention\Image\Interfaces\ModifierInterface;
|
||||||
use Intervention\Image\ModifierStack;
|
use Intervention\Image\ModifierStack;
|
||||||
use Mockery;
|
use Mockery;
|
||||||
|
|
||||||
@@ -29,14 +30,14 @@ class ModifierStackTest extends TestCase
|
|||||||
{
|
{
|
||||||
$image = Mockery::mock(ImageInterface::class);
|
$image = Mockery::mock(ImageInterface::class);
|
||||||
|
|
||||||
$modifier1 = Mockery::mock(AbstractColor::class)->makePartial();
|
$modifier1 = Mockery::mock(ModifierInterface::class)->makePartial();
|
||||||
$modifier1->shouldReceive('apply')->once()->with($image);
|
$modifier1->shouldReceive('apply')->once()->with($image);
|
||||||
|
|
||||||
$modifier2 = Mockery::mock(AbstractColor::class)->makePartial();
|
$modifier2 = Mockery::mock(ModifierInterface::class)->makePartial();
|
||||||
$modifier2->shouldReceive('apply')->once()->with($image);
|
$modifier2->shouldReceive('apply')->once()->with($image);
|
||||||
|
|
||||||
$stack = new ModifierStack([$modifier1, $modifier2]);
|
$stack = new ModifierStack([$modifier1, $modifier2]);
|
||||||
$result = $stack->apply($image);
|
$result = $stack->apply($image);
|
||||||
$this->assertInstanceOf(ImageInterface::class, $image);
|
$this->assertInstanceOf(ImageInterface::class, $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user