mirror of
https://github.com/Intervention/image.git
synced 2025-08-20 04:31:24 +02:00
Rename class
This commit is contained in:
@@ -7,7 +7,7 @@ use Intervention\Image\Interfaces\ColorInterface;
|
|||||||
use Intervention\Image\Interfaces\DecoderInterface;
|
use Intervention\Image\Interfaces\DecoderInterface;
|
||||||
use Intervention\Image\Interfaces\ImageInterface;
|
use Intervention\Image\Interfaces\ImageInterface;
|
||||||
|
|
||||||
class HexColorDecoder extends ArrayColorDecoder implements DecoderInterface
|
class HexColorDecoder extends RgbArrayColorDecoder implements DecoderInterface
|
||||||
{
|
{
|
||||||
public function decode($input): ImageInterface|ColorInterface
|
public function decode($input): ImageInterface|ColorInterface
|
||||||
{
|
{
|
||||||
|
@@ -10,7 +10,7 @@ use Intervention\Image\Interfaces\DecoderInterface;
|
|||||||
use Intervention\Image\Interfaces\ImageInterface;
|
use Intervention\Image\Interfaces\ImageInterface;
|
||||||
use Intervention\Image\Traits\CanValidateColors;
|
use Intervention\Image\Traits\CanValidateColors;
|
||||||
|
|
||||||
class ArrayColorDecoder extends AbstractDecoder implements DecoderInterface
|
class RgbArrayColorDecoder extends AbstractDecoder implements DecoderInterface
|
||||||
{
|
{
|
||||||
use CanValidateColors;
|
use CanValidateColors;
|
||||||
|
|
@@ -7,7 +7,7 @@ use Intervention\Image\Interfaces\ColorInterface;
|
|||||||
use Intervention\Image\Interfaces\DecoderInterface;
|
use Intervention\Image\Interfaces\DecoderInterface;
|
||||||
use Intervention\Image\Interfaces\ImageInterface;
|
use Intervention\Image\Interfaces\ImageInterface;
|
||||||
|
|
||||||
class RgbStringColorDecoder extends ArrayColorDecoder implements DecoderInterface
|
class RgbStringColorDecoder extends RgbArrayColorDecoder implements DecoderInterface
|
||||||
{
|
{
|
||||||
public function decode($input): ImageInterface|ColorInterface
|
public function decode($input): ImageInterface|ColorInterface
|
||||||
{
|
{
|
||||||
|
@@ -7,7 +7,7 @@ use Intervention\Image\Interfaces\ColorInterface;
|
|||||||
use Intervention\Image\Interfaces\DecoderInterface;
|
use Intervention\Image\Interfaces\DecoderInterface;
|
||||||
use Intervention\Image\Interfaces\ImageInterface;
|
use Intervention\Image\Interfaces\ImageInterface;
|
||||||
|
|
||||||
class TransparentColorDecoder extends ArrayColorDecoder implements DecoderInterface
|
class TransparentColorDecoder extends RgbArrayColorDecoder implements DecoderInterface
|
||||||
{
|
{
|
||||||
public function decode($input): ImageInterface|ColorInterface
|
public function decode($input): ImageInterface|ColorInterface
|
||||||
{
|
{
|
||||||
|
@@ -9,7 +9,7 @@ class InputHandler extends AbstractInputHandler
|
|||||||
protected $decoders = [
|
protected $decoders = [
|
||||||
Decoders\ImageObjectDecoder::class,
|
Decoders\ImageObjectDecoder::class,
|
||||||
Decoders\FilePointerImageDecoder::class,
|
Decoders\FilePointerImageDecoder::class,
|
||||||
Decoders\ArrayColorDecoder::class,
|
Decoders\RgbArrayColorDecoder::class,
|
||||||
Decoders\HtmlColorNameDecoder::class,
|
Decoders\HtmlColorNameDecoder::class,
|
||||||
Decoders\RgbStringColorDecoder::class,
|
Decoders\RgbStringColorDecoder::class,
|
||||||
Decoders\HexColorDecoder::class,
|
Decoders\HexColorDecoder::class,
|
||||||
|
@@ -7,7 +7,7 @@ use Intervention\Image\Interfaces\ColorInterface;
|
|||||||
use Intervention\Image\Interfaces\DecoderInterface;
|
use Intervention\Image\Interfaces\DecoderInterface;
|
||||||
use Intervention\Image\Interfaces\ImageInterface;
|
use Intervention\Image\Interfaces\ImageInterface;
|
||||||
|
|
||||||
class HexColorDecoder extends ArrayColorDecoder implements DecoderInterface
|
class HexColorDecoder extends RgbArrayColorDecoder implements DecoderInterface
|
||||||
{
|
{
|
||||||
public function decode($input): ImageInterface|ColorInterface
|
public function decode($input): ImageInterface|ColorInterface
|
||||||
{
|
{
|
||||||
|
@@ -11,7 +11,7 @@ use Intervention\Image\Interfaces\DecoderInterface;
|
|||||||
use Intervention\Image\Interfaces\ImageInterface;
|
use Intervention\Image\Interfaces\ImageInterface;
|
||||||
use Intervention\Image\Traits\CanValidateColors;
|
use Intervention\Image\Traits\CanValidateColors;
|
||||||
|
|
||||||
class ArrayColorDecoder extends AbstractDecoder implements DecoderInterface
|
class RgbArrayColorDecoder extends AbstractDecoder implements DecoderInterface
|
||||||
{
|
{
|
||||||
use CanValidateColors;
|
use CanValidateColors;
|
||||||
|
|
@@ -7,7 +7,7 @@ use Intervention\Image\Interfaces\ColorInterface;
|
|||||||
use Intervention\Image\Interfaces\DecoderInterface;
|
use Intervention\Image\Interfaces\DecoderInterface;
|
||||||
use Intervention\Image\Interfaces\ImageInterface;
|
use Intervention\Image\Interfaces\ImageInterface;
|
||||||
|
|
||||||
class TransparentColorDecoder extends ArrayColorDecoder implements DecoderInterface
|
class TransparentColorDecoder extends RgbArrayColorDecoder implements DecoderInterface
|
||||||
{
|
{
|
||||||
public function decode($input): ImageInterface|ColorInterface
|
public function decode($input): ImageInterface|ColorInterface
|
||||||
{
|
{
|
||||||
|
@@ -9,7 +9,7 @@ class InputHandler extends AbstractInputHandler
|
|||||||
protected $decoders = [
|
protected $decoders = [
|
||||||
Decoders\ImageObjectDecoder::class,
|
Decoders\ImageObjectDecoder::class,
|
||||||
Decoders\FilePointerImageDecoder::class,
|
Decoders\FilePointerImageDecoder::class,
|
||||||
Decoders\ArrayColorDecoder::class,
|
Decoders\RgbArrayColorDecoder::class,
|
||||||
Decoders\HexColorDecoder::class,
|
Decoders\HexColorDecoder::class,
|
||||||
Decoders\HtmlColorNameDecoder::class,
|
Decoders\HtmlColorNameDecoder::class,
|
||||||
Decoders\RgbStringColorDecoder::class,
|
Decoders\RgbStringColorDecoder::class,
|
||||||
|
@@ -3,18 +3,18 @@
|
|||||||
namespace Intervention\Image\Tests\Drivers\Gd\Decoders;
|
namespace Intervention\Image\Tests\Drivers\Gd\Decoders;
|
||||||
|
|
||||||
use Intervention\Image\Drivers\Gd\Color;
|
use Intervention\Image\Drivers\Gd\Color;
|
||||||
use Intervention\Image\Drivers\Gd\Decoders\ArrayColorDecoder;
|
use Intervention\Image\Drivers\Gd\Decoders\RgbArrayColorDecoder;
|
||||||
use Intervention\Image\Tests\TestCase;
|
use Intervention\Image\Tests\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @requires extension gd
|
* @requires extension gd
|
||||||
* @covers \Intervention\Image\Drivers\Gd\Decoders\ArrayColorDecoder
|
* @covers \Intervention\Image\Drivers\Gd\Decoders\RgbArrayColorDecoder
|
||||||
*/
|
*/
|
||||||
class ArrayColorDecoderTest extends TestCase
|
class RgbArrayColorDecoderTest extends TestCase
|
||||||
{
|
{
|
||||||
public function testDecode(): void
|
public function testDecode(): void
|
||||||
{
|
{
|
||||||
$decoder = new ArrayColorDecoder();
|
$decoder = new RgbArrayColorDecoder();
|
||||||
$color = $decoder->decode([181, 55, 23, .5]);
|
$color = $decoder->decode([181, 55, 23, .5]);
|
||||||
$this->assertInstanceOf(Color::class, $color);
|
$this->assertInstanceOf(Color::class, $color);
|
||||||
$this->assertEquals(181, $color->red());
|
$this->assertEquals(181, $color->red());
|
@@ -3,18 +3,18 @@
|
|||||||
namespace Intervention\Image\Tests\Drivers\Imagick\Decoders;
|
namespace Intervention\Image\Tests\Drivers\Imagick\Decoders;
|
||||||
|
|
||||||
use Intervention\Image\Drivers\Imagick\Color;
|
use Intervention\Image\Drivers\Imagick\Color;
|
||||||
use Intervention\Image\Drivers\Imagick\Decoders\ArrayColorDecoder;
|
use Intervention\Image\Drivers\Imagick\Decoders\RgbArrayColorDecoder;
|
||||||
use Intervention\Image\Tests\TestCase;
|
use Intervention\Image\Tests\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @requires extension imagick
|
* @requires extension imagick
|
||||||
* @covers \Intervention\Image\Drivers\Imagick\Decoders\ArrayColorDecoder
|
* @covers \Intervention\Image\Drivers\Imagick\Decoders\RgbArrayColorDecoder
|
||||||
*/
|
*/
|
||||||
class ArrayColorDecoderTest extends TestCase
|
class RgbArrayColorDecoderTest extends TestCase
|
||||||
{
|
{
|
||||||
public function testDecode(): void
|
public function testDecode(): void
|
||||||
{
|
{
|
||||||
$decoder = new ArrayColorDecoder();
|
$decoder = new RgbArrayColorDecoder();
|
||||||
$color = $decoder->decode([181, 55, 23, .5]);
|
$color = $decoder->decode([181, 55, 23, .5]);
|
||||||
$this->assertInstanceOf(Color::class, $color);
|
$this->assertInstanceOf(Color::class, $color);
|
||||||
$this->assertEquals(181, $color->red());
|
$this->assertEquals(181, $color->red());
|
Reference in New Issue
Block a user