oont-contents/plugins/webp-converter-for-media/src/Exception/FilesizeOversizeException.php
2025-02-08 15:10:23 +01:00

31 lines
578 B
PHP

<?php
namespace WebpConverter\Exception;
/**
* {@inheritdoc}
*/
class FilesizeOversizeException extends ExceptionAbstract {
const ERROR_MESSAGE = 'Image is larger than the maximum size of %1$sMB: "%2$s".';
const ERROR_CODE = 'max_filezile';
/**
* {@inheritdoc}
*/
public function get_error_message( array $values ): string {
$number = (int) $values[0];
return sprintf(
self::ERROR_MESSAGE,
round( $number / 1024 / 1024 ),
$values[1]
);
}
/**
* {@inheritdoc}
*/
public function get_error_status(): string {
return self::ERROR_CODE;
}
}