mirror of
https://github.com/Intervention/image.git
synced 2025-09-01 01:51:43 +02:00
Rename ImageInterface::toMediaType()
This commit is contained in:
@@ -748,9 +748,9 @@ final class Image implements ImageInterface, Countable
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see ImageInterface::toMediaType()
|
||||
* @see ImageInterface::encodeByMediaType()
|
||||
*/
|
||||
public function toMediaType(?string $type = null): EncodedImageInterface
|
||||
public function encodeByMediaType(?string $type = null): EncodedImageInterface
|
||||
{
|
||||
return $this->encode(new MediaTypeEncoder($type));
|
||||
}
|
||||
|
@@ -564,7 +564,7 @@ interface ImageInterface extends IteratorAggregate, Countable
|
||||
* @param null|string $type
|
||||
* @return EncodedImageInterface
|
||||
*/
|
||||
public function toMediaType(?string $type = null): EncodedImageInterface;
|
||||
public function encodeByMediaType(?string $type = null): EncodedImageInterface;
|
||||
|
||||
/**
|
||||
* Encode image to JPEG format
|
||||
|
@@ -122,13 +122,13 @@ class ImageTest extends TestCase
|
||||
$this->assertMediaType('image/gif', (string) $result);
|
||||
}
|
||||
|
||||
public function testToMediaType(): void
|
||||
public function testEncodeByMediaType(): void
|
||||
{
|
||||
$result = $this->readTestImage('blue.gif')->toMediaType();
|
||||
$result = $this->readTestImage('blue.gif')->encodeByMediaType();
|
||||
$this->assertInstanceOf(EncodedImage::class, $result);
|
||||
$this->assertMediaType('image/gif', (string) $result);
|
||||
|
||||
$result = $this->readTestImage('blue.gif')->toMediaType('image/png');
|
||||
$result = $this->readTestImage('blue.gif')->encodeByMediaType('image/png');
|
||||
$this->assertInstanceOf(EncodedImage::class, $result);
|
||||
$this->assertMediaType('image/png', (string) $result);
|
||||
}
|
||||
|
@@ -121,13 +121,13 @@ class ImageTest extends TestCase
|
||||
$this->assertMediaType('image/gif', (string) $result);
|
||||
}
|
||||
|
||||
public function testToMediaType(): void
|
||||
public function testEncodeByMediaType(): void
|
||||
{
|
||||
$result = $this->readTestImage('blue.gif')->toMediaType();
|
||||
$result = $this->readTestImage('blue.gif')->encodeByMediaType();
|
||||
$this->assertInstanceOf(EncodedImage::class, $result);
|
||||
$this->assertMediaType('image/gif', (string) $result);
|
||||
|
||||
$result = $this->readTestImage('blue.gif')->toMediaType('image/png');
|
||||
$result = $this->readTestImage('blue.gif')->encodeByMediaType('image/png');
|
||||
$this->assertInstanceOf(EncodedImage::class, $result);
|
||||
$this->assertMediaType('image/png', (string) $result);
|
||||
}
|
||||
|
Reference in New Issue
Block a user