1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Remove trait

This commit is contained in:
David Bomba 2023-11-08 19:54:26 +11:00
parent bc4215a1b5
commit cb94973bd1
2 changed files with 14 additions and 32 deletions

View File

@ -1,31 +0,0 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Helpers\Document;
trait WithTypeHelpers
{
/**
* Returns boolean based on checks for image.
*
* @return bool
*/
public function isImage(): bool
{
if (in_array($this->type, ['png', 'jpeg', 'jpg', 'tiff', 'gif'])) {
return true;
}
return false;
}
}

View File

@ -64,7 +64,6 @@ class Document extends BaseModel
{
use SoftDeletes;
use Filterable;
use WithTypeHelpers;
const DOCUMENT_PREVIEW_SIZE = 300; // pixels
@ -234,4 +233,18 @@ class Document extends BaseModel
}
/**
* Returns boolean based on checks for image.
*
* @return bool
*/
public function isImage(): bool
{
if (in_array($this->type, ['png', 'jpeg', 'jpg', 'tiff', 'gif'])) {
return true;
}
return false;
}
}