mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-05 20:10:57 +00:00
Code cleanup.
This commit is contained in:
@@ -12,6 +12,21 @@ use FireflyIII\Models\Attachment;
|
||||
class AttachmentRepository implements AttachmentRepositoryInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function destroy(Attachment $attachment)
|
||||
{
|
||||
/** @var \FireflyIII\Helpers\Attachments\AttachmentHelperInterface $helper */
|
||||
$helper = app('FireflyIII\Helpers\Attachments\AttachmentHelperInterface');
|
||||
|
||||
$file = $helper->getAttachmentLocation($attachment);
|
||||
unlink($file);
|
||||
$attachment->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
* @param array $data
|
||||
@@ -29,19 +44,4 @@ class AttachmentRepository implements AttachmentRepositoryInterface
|
||||
return $attachment;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function destroy(Attachment $attachment)
|
||||
{
|
||||
/** @var \FireflyIII\Helpers\Attachments\AttachmentHelperInterface $helper */
|
||||
$helper = app('FireflyIII\Helpers\Attachments\AttachmentHelperInterface');
|
||||
|
||||
$file = $helper->getAttachmentLocation($attachment);
|
||||
unlink($file);
|
||||
$attachment->delete();
|
||||
}
|
||||
}
|
||||
|
@@ -12,6 +12,13 @@ use FireflyIII\Models\Attachment;
|
||||
interface AttachmentRepositoryInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function destroy(Attachment $attachment);
|
||||
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
* @param array $attachmentData
|
||||
@@ -19,12 +26,5 @@ interface AttachmentRepositoryInterface
|
||||
* @return Attachment
|
||||
*/
|
||||
public function update(Attachment $attachment, array $attachmentData);
|
||||
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function destroy(Attachment $attachment);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user