Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5/** @license For full copyright and license information, please see the LICENSE.md file. */
6
7namespace App\Modules\Comments\Application\Service;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11use App\Modules\Comments\Domain\Model\CommentAttachment;
12
13/**
14 * Interface for CommentAttachmentService.
15 *
16 * @package App\Modules\Comments\Application\Service
17 */
18interface CommentAttachmentServiceInterface
19{
20    /**
21     * Validates file size, extension and content MIME signature.
22     */
23    public function validateFile(string $fileName, int $fileSize, ?string $tmpPath = null): void;
24
25    /**
26     * Stores uploaded file outside document root and creates database attachment entity.
27     */
28    public function storeAttachment(
29        string $tmpPath,
30        string $clientName,
31        int $fileSize,
32        int $commentId,
33        int $userId
34    ): CommentAttachment;
35
36    /**
37     * Resolves absolute storage path from relative path.
38     */
39    public function resolveAbsolutePath(string $relativePath): ?string;
40
41    /**
42     * Resolves root storage base directory.
43     */
44    public function resolveStorageBase(): string;
45}