diff --git a/src/Services/AttachmentHelper.php b/src/Services/Attachments/AttachmentManager.php similarity index 93% rename from src/Services/AttachmentHelper.php rename to src/Services/Attachments/AttachmentManager.php index 6cceb64a..a64ba066 100644 --- a/src/Services/AttachmentHelper.php +++ b/src/Services/Attachments/AttachmentManager.php @@ -50,7 +50,15 @@ use App\Services\Attachments\AttachmentPathResolver; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\OptionsResolver\OptionsResolver; -class AttachmentHelper +/** + * This service contains basic commonly used functions to work with attachments. + * Especially this services gives you important infos about attachments, that can not be retrieved via the entities + * (like filesize or if a file is existing). + * + * Special operations like getting attachment urls or handling file uploading/downloading are in their own services. + * @package App\Services + */ +class AttachmentManager { protected $pathResolver; @@ -167,8 +175,4 @@ class AttachmentHelper $factor = (int) floor((strlen($bytes) - 1) / 3); return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor) . @$sz[$factor]; } - - - - } \ No newline at end of file diff --git a/src/Services/AttachmentReverseSearch.php b/src/Services/Attachments/AttachmentReverseSearch.php similarity index 96% rename from src/Services/AttachmentReverseSearch.php rename to src/Services/Attachments/AttachmentReverseSearch.php index fd732e20..6345f155 100644 --- a/src/Services/AttachmentReverseSearch.php +++ b/src/Services/Attachments/AttachmentReverseSearch.php @@ -61,8 +61,8 @@ class AttachmentReverseSearch /** * Find all attachments that use the given file - * @param File $file - * @return Attachment[] + * @param \SplFileInfo $file The file for which is searched + * @return Attachment[] An list of attachments that use the given file. */ public function findAttachmentsByFile(\SplFileInfo $file) : array { diff --git a/src/Services/BuiltinAttachmentsFinder.php b/src/Services/Attachments/BuiltinAttachmentsFinder.php similarity index 100% rename from src/Services/BuiltinAttachmentsFinder.php rename to src/Services/Attachments/BuiltinAttachmentsFinder.php