mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Added PHP7 return type statements.
This commit is contained in:
@@ -18,7 +18,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function destroy(Attachment $attachment)
|
||||
public function destroy(Attachment $attachment): bool
|
||||
{
|
||||
/** @var \FireflyIII\Helpers\Attachments\AttachmentHelperInterface $helper */
|
||||
$helper = app('FireflyIII\Helpers\Attachments\AttachmentHelperInterface');
|
||||
@@ -26,6 +26,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface
|
||||
$file = $helper->getAttachmentLocation($attachment);
|
||||
unlink($file);
|
||||
$attachment->delete();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,7 +35,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface
|
||||
*
|
||||
* @return Attachment
|
||||
*/
|
||||
public function update(Attachment $attachment, array $data)
|
||||
public function update(Attachment $attachment, array $data): Attachment
|
||||
{
|
||||
|
||||
$attachment->title = $data['title'];
|
||||
|
@@ -18,7 +18,7 @@ interface AttachmentRepositoryInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function destroy(Attachment $attachment);
|
||||
public function destroy(Attachment $attachment): bool;
|
||||
|
||||
/**
|
||||
* @param Attachment $attachment
|
||||
@@ -26,6 +26,6 @@ interface AttachmentRepositoryInterface
|
||||
*
|
||||
* @return Attachment
|
||||
*/
|
||||
public function update(Attachment $attachment, array $attachmentData);
|
||||
public function update(Attachment $attachment, array $attachmentData): Attachment;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user