Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** @license For full copyright and license information, please see the LICENSE.md file. */ |
| 6 | |
| 7 | namespace App\Core\Engine\Application\Service; |
| 8 | |
| 9 | defined('AMMONLY_APP') || exit('Direct script access is forbidden.'); |
| 10 | |
| 11 | use Psr\Http\Message\UploadedFileInterface; |
| 12 | |
| 13 | /** |
| 14 | * Contract for Image Upload and Thumbnail Generation Service. |
| 15 | * |
| 16 | * @package App\Core\Engine\Application\Service |
| 17 | */ |
| 18 | interface ImageUploadServiceInterface |
| 19 | { |
| 20 | /** |
| 21 | * Processes and stores an uploaded image file, generating a thumbnail. |
| 22 | * |
| 23 | * @param UploadedFileInterface $file Uploaded PSR-7 file instance. |
| 24 | * @param string $subfolder Optional relative subdirectory (default 'media'). |
| 25 | * @return array{ |
| 26 | * name: string, |
| 27 | * path: string, |
| 28 | * thumb: string, |
| 29 | * size: int, |
| 30 | * mime: string, |
| 31 | * width: int, |
| 32 | * height: int |
| 33 | * } Image metadata with public URLs. |
| 34 | */ |
| 35 | public function uploadImage(UploadedFileInterface $file, string $subfolder = 'media'): array; |
| 36 | } |