mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 10:39:01 -04:00 
			
		
		
		
	Remove trait
This commit is contained in:
		
							parent
							
								
									bc4215a1b5
								
							
						
					
					
						commit
						cb94973bd1
					
				| @ -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; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @ -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; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user