23 lines
686 B
PHP
23 lines
686 B
PHP
<?php
|
|
|
|
namespace App\Tests\Domain\Manga\Adapter;
|
|
|
|
use App\Domain\Manga\Domain\Contract\Service\ImageProcessorInterface;
|
|
|
|
class InMemoryImageProcessor implements ImageProcessorInterface
|
|
{
|
|
private const string FULL_IMAGE_PATH = '/images/full';
|
|
private const string THUMBNAIL_PATH = '/images/thumbnails';
|
|
|
|
public function downloadImage(string $imageUrl): string
|
|
{
|
|
$filename = sprintf('%s/%s.jpg', self::FULL_IMAGE_PATH, uniqid());
|
|
return $filename;
|
|
}
|
|
|
|
public function createThumbnail(string $originalImagePath): string
|
|
{
|
|
$filename = basename($originalImagePath);
|
|
return sprintf('%s/%s', self::THUMBNAIL_PATH, $filename);
|
|
}
|
|
}
|