- Implemented tests to verify the functionality of the ImageOptimizerService. - Tests cover optimization of supported image formats, handling of unsupported files, and cleanup of temporary files. - Added functionality to store optimized images onto disk using a storage service.
13 lines
316 B
PHP
13 lines
316 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Exceptions;
|
|
|
|
class ImageOptimizerException extends \RuntimeException
|
|
{
|
|
public static function of(?string $message = null, ?\Throwable $cause = null): self
|
|
{
|
|
return new self($message ?? 'An image optimization error occurred.', previous: $cause);
|
|
}
|
|
}
|